close
0

Display SnackBar in Flutter

avatar
asked 04-09-2021

2 Answers


0

The simplest solution is to change the home line in your MyApp widget to:

home: new Scaffold(body: new MyHomePage()),

avatar
answered 04-09-2021

0

No need to change in your main app part

class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
  return new MaterialApp(
    title: 'MyApp',
    theme: new ThemeData(
    primarySwatch: Colors.orange),
    home: new MainPage());
  }
}
avatar
answered 04-09-2021