Scaffold.of() called with a context that does not contain a Scaffold

As you can see, my button is inside the Scaffold‘s body. But I get this exception: Scaffold.of() called with a context that does not contain a Scaffold. import ‘package:flutter/material.dart’; void main() => runApp(MyApp()); class MyApp extends StatelessWidget { @override Widget build(BuildContext context) { return MaterialApp( title: ‘Flutter Demo’, theme: ThemeData( primarySwatch: Colors.blue, ), home: HomePage(), … Read more