Home > database >  How to show snack bar in flutter?
How to show snack bar in flutter?

Time:12-13

I am developing flutter calculator app And when I am getting numbers from textfields just I want to show snackbar if the one of the textfield is empty or If both of them are empty after clicking a button if they are not empty I am showing the sum result and in this case I don't have any problem And to be more specific I am adding a picture of my simple app

I tried showsnakbarmassenger.of(context).showsnackbare and other codes after reading documentation and watching videos in YouTube but I got error no scaffold messenger widget found.

CodePudding user response:

Those are deprecated APIs, currently you can show a snackBar with this:

ScaffoldMessenger.of(context).showSnackBar(SnackBar(content: Text("example text")));
  • Related