Flutter is a framework for building frontends that work natively on Android, iOS, Windows, macOS, Linux and web browsers, all from a single codebase. Although you can target many different platforms, it’s hard to build a unified experience on all of them and the codebase will become more complex, so it’s common for people to exclusively use Flutter for mobile development and then build out a web frontend separately, for example.
Flutter ships with a comprehensive widget library and Google maintains many of its plugins. Flutter has its own rendering engine built with C++ and Skia which is credited with being highly performant (substantially better rendering performance than React Native). This means your Dart code renders custom UI elements to the screen, not native elements like React Native would.
Core
Flutter’s UI component hierarchy is similar to React’s. In Flutter, we call UI components widgets. Every widget has a build
method that declares how the widget is displayed and what it’s composed of (this is similar to the render
method in React components).
TODO:
Colors
classIcon
classBuildContext
. Every widget’sbuild
method takes in a BuildContext. Things likeNavigator
,MediaQuery
,ListView.builder
all need it.ThemeData
Stateful Widgets
Stateless widgets are immutable.
Stateful widgets maintain state over time and is create through extending StatefulWidget
which creates an instance of State
.
TODO:
setState
Routing
TODO:
Navigator
contains a stack of routes. Pushing to this stack changes the route. Popping navigates back.
Theming
Widgets Reference
ListView
Scaffold
AppBar
IconButton
Flutter Architecture
Flutter CLI
Flare
TODO: https://www.youtube.com/watch?v=hwBUU9CP4qI&ab_channel=Fireship