Let's start by setting up a Scaffold widget:
- In basic_screen.dart, type stless to create a new stateless widget and name that widget BasicScreen. Don't forget to import the material library as well:
import 'package:flutter/material.dart';
class BasicScreen extends StatelessWidget {
@override
Widget build(BuildContext context) {
return Container();
}
}
- Now, in main.dart, replace ImmutableWidget with BasicScreen. Hit the save button to hot reload and your simulator screen should be completely white:
import 'package:flutter/material.dart';
import './basic_screen.dart';
void main() => runApp(StaticApp());
class StaticApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: BasicScreen(),
);
}
}
- Now it's time to bring in the scaffold. In basic_screen.dart, we're going to add the widget that was created in the previous recipe, but bring...