I am creating a flutter registration app and is giving this error what should I do? can anyone please help me?

Asked

Viewed 29 times

-1

A non-null string must be provided to a text widget. 'package: flutter / src / widgets / text.Dart': Failed assertion: line 360 pos 10: 'data! = Null'

  • When you try to use a variable to set a text to a Widget Text() requires that the variable is not null... Seven the value as follows Text(minhaVariavel ?? "")... This will cause if the variable is null, a blank value is set.

  • OK thank you very much.

1 answer

0

You are trying to use a text widget with null value. Check that the value is coming correctly and if the value is only updated after the widget is rendered, you can do it as follows:

Text(variavel != null ? variavel : null)
  • OK thank you very much.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.