Flutter Widgets
How Widgets Organize Themselves
Example of a Simple Widget Tree
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return MaterialApp(
home: Scaffold(
appBar: AppBar(
title: const Text('My Home Page'),
),
body: Center(
child: Column(
children: [
const Text('Hello World'),
const SizedBox(height: 20),
ElevatedButton(
onPressed: () {
print('Click!');
},
child: const Text('A button'),
),
],
),
),
),
);
}
}
Updating the UI
Flutter's Approach to UI
Widget Composition
Building Widgets
Stateless vs. Stateful Widgets
Managing State
Key Takeaways
Last updated