How to apply ternary operator on text widget

Posted by

// flight set variable 
//  note: value should be in "1"
                               widget.flight=='1'?Text(  
                                // Text(
                                  "Flight",
                                  textAlign: TextAlign.left,
                                  style: TextStyle(
                                      color: Colors.black, fontSize: 15),
                                ):Text(
                                  "",
                                  textAlign: TextAlign.left,
                                  style: TextStyle(
                                      color: Colors.black, fontSize: 15),
                                ),

0 0 votes
Article Rating
Subscribe
Notify of
guest
1 Comment
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
trackback

[…] And if want to know to ternary operator in flutter.If you want more clarity output please click here. […]

1
0
Would love your thoughts, please comment.x
()
x