Home > Blockchain >  Error: The method isn't defined for the class in Flutter and Module was compiled with an icompa
Error: The method isn't defined for the class in Flutter and Module was compiled with an icompa

Time:09-20

I was just trying out a source code that I have seen online, and I wanted to test it, however, it is giving me multiple errors because of the new update on widgets.

The source code that I am trying to run and execute is: Error for running the app

CodePudding user response:

This is because your version of Flutter is newer than that of the library. The library still uses FlatButton for example which was removed as a breaking change

Replace every FlatButton with TextButton and for showing a SnackBar you can use:

ScaffoldMessenger.of(context).showSnackBar(snackBar);
  • Related