Step 1 / 5
runApp mounts the root widget
runApp() takes a widget and makes it fill the screen. Everything you see from then on is a descendant of that one widget.
Build a screen by composing small widgets into a tree, and see what build() really returns.
1import 'package:flutter/material.dart';23void main() => runApp(const MyApp());45class MyApp extends StatelessWidget {6 const MyApp({super.key});78 @override9 Widget build(BuildContext context) {10 return MaterialApp(11 home: Scaffold(12 appBar: AppBar(title: const Text('Hello')),13 body: const Center(child: Text('Hello, Flutter!')),14 ),15 );16 }17}
runApp() takes a widget and makes it fill the screen. Everything you see from then on is a descendant of that one widget.