dimanche 3 mai 2020

Why do I get an error by using tenary operator?

I tried to make a Text, which should only be visible, if variable1 == "1", but I got an error. can anybody tell me why I get this error? Below is the code I tried. Thanks in advance!

Padding(
                padding: const EdgeInsets.symmetric(vertical: 28.0),
                child:
                Container(
                  child: variable1 == "1"
                  ?Text(
                    "Test",
                    style: TextStyle(fontSize: 25),
                  ),
                ),
              ), 

Aucun commentaire:

Enregistrer un commentaire