skip to Main Content

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

2

Answers


  1. 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.

    Login or Signup to reply.
  2. You can use like conditional if on widget

    if (isUser) Text("hello")
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search