Home > front end >  Inline without else in dart
Inline without else in dart

Time:11-04

I am trying to do this without else in dart isUser == true && Text("hello") but this gives me an error while if I do that in react native it works any help

CodePudding user response:

You can use like conditional if on widget

if (isUser) Text("hello")

CodePudding user response:

You question is very obscure but if I understand you correct:

isUser ? Text("hello") : Text("you are not a user :<"); 

of

isUser ? Text("hello") : null; 

Also give yourself some time to look at language tour.

  • Related