An architectural design pattern for the Flutter framework.
Features:
- Separation of models, logic and view
- A firm and consistent directory structure easy to understand
- Treatment of models and data providers as microservices separate from the main application
- Abstraction of data repositories allowing modular backend implementation
The goal is to allow you employ clean architecture in Flutter, simplifying the separation of code into independent layers. These rules will ensure that your project is scalable, easy to read and consistent while maintaining simplicity.
Flutterfall is based on bloc for stream-based state-management, formz for form representation input and equatable. It also features a VSCode extension to help a quick implementation.
- Intermediate knowledge of Flutter, streams and BLoC
- (For the extension) VSCode installed on your system
If you are in doubt on how bloc works, I recommend this article.
The general directory structure of a Flutterfall app looks similar to this:
my_flutter_app/
├─ lib/
│ ├─ app/
│ ├─ authentication/
│ ├─ profile_creation/
│ ├─ main.dart
├─ packages/
│ ├─ my_flutter_authentication/
│ ├─ my_flutter_theme/
├─ pubspec.yaml
- /lib/ contains folders each representing a feature (eg. /profile_creation/)
- /packages/ has Flutter or Dart modules that are either a widget library (/my_flutter_theme/) or a domain of models and data repositories (/my_flutter_authentication/).
You can use the extension to quickly create features or packages.