A sample flutter app that has mutliple features.
- flutter 3.+
- Android Studio
App has multiple features - posts, weather. Each feature split in to 3 modules
- Presentation - contains Presentation Layer (widgets and cubits)
- Domain - contains Domain layer with business logic (interactors and interfaces)
- Data - contains Data layer with REST API requests
- UI sends signals to Cubit
- Cubit executes Use cases from Interactor.
- Use case obtains data from Repository
- Repository returns data from a Api.
- Information flows back to the UI to be displayed.
Presentation and Data depends on Domain, but Domain know nothing about them.
.run scripts
- build_runner - generate code for JSON Serializable
- clean_all - run
flutter clean
in all modules - pub_get_all - run
flutter pub get
in all modules - generate_translate_file - regenerate localized strings
- main.dart - run app
- run
flutter create
in feature directory with unique project name. For example:flutter create --template=package --project-name features_weather_presentation presentation
- remove unused files. For example:
cd presentation && rm -rf android ios linux macos windows LICENSE CHANGELOG.md
- replace
homepage:
withpublish_to: none
inpodspec.yaml
- add dependencies from other modules
- add this module as dependency to other modules using
path:
- replace flutter_modular with something usable
- cfug/dio#1653
- move code to src directory and use export show for exposing package apis
- add paging
- on error dismiss previous errors and add option to refresh after error
- add loading indicators using Lottie
- split localized string per module
- https://pub.dev/packages/mapify_generator
- https://pub.dev/packages/easy_localization
- https://pub.dev/packages/auto_route
- https://pub.dev/packages/freezed
- create simple module as template
- fature module should not depend on eachother, all communication via small interfaces in common module
- replace helper methods with widgets