Flutter hide/show Widget

To Hide or Show Flutter Widget, You can use Dart’s Ternary operator. here is the basic example Code :

isDataLoading ? CircularProgressIndicator() : Text("Data Fetched Successfully");

after write above code you can toggle Widget visibility using setState method. Like this :

setState((){
  isDataLoading = false;
});
Share

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *