Flutter
Flutter is Googleβs open-source UI toolkit for building natively compiled applications for mobile, web, and desktop from a single codebase using the Dart language.
Core Concepts
Widgets
Everything in Flutter is a widget. Widgets describe what their view should look like given their current configuration and state.
- StatelessWidget β immutable, rebuilt only when parent changes
- StatefulWidget β mutable state, can trigger rebuilds via
setState()
The Widget Tree
MaterialApp
βββ Scaffold
βββ AppBar
βββ body: Column
βββ Text('Hello')
βββ ElevatedButton(...)State Management
| Approach | Best For |
|---|---|
setState | Local, simple widget state |
Provider | App-wide state, simple DI |
Riverpod | Scalable, testable state (recommended) |
Bloc/Cubit | Complex business logic separation |
Project Structure (recommended)
lib/
βββ main.dart
βββ app.dart
βββ features/
β βββ auth/
β βββ data/
β βββ domain/
β βββ presentation/
βββ shared/
β βββ widgets/
β βββ theme/
βββ core/
βββ router/
βββ services/References
- Flutter Team. Flutter Documentation. https://docs.flutter.devΒ
- Dart Team. Dart Language Tour. https://dart.dev/languageΒ
- Riverpod. Riverpod Documentation. https://riverpod.devΒ
Last updated on