flutter architecture blueprints
flutter architecture blueprints is a project that introduces mvvm architecture and project structure approaches to developing flutter apps.
installation
- asdf
- dart 2.14.4
- flutter 2.5.3
- npm (for git hooks)
environment
ios
- ios 13+
android
- android 5.1+
- minsdkversion 22
- targetsdkversion 30
app architecture
- base on mvvm + repository
code style
assets, fonts
if added some assets or fonts
- use fluttergen
models
if added some models for api results
- use freezed
localizations
if added some localizations (i.g. edited *.arb)
git commit message style
code collections
project settings
working status | category | description | codes |
---|---|---|---|
✅ | dart | dart version | pubspec.yaml |
✅ | asdf | asdf | .tool-versions |
✅ | dart | switching between development and production environment | constants.dart, runconfigurations, makefile |
✅ | dart | lint / analyze | analysis_options.yaml |
✅ | android | kotlin version | build.gradle |
✅ | android | apk attributes | build.gradle (compilesdkversion, applicationid, minsdkversion, targetsdkversion) |
✅ | android | switching between development and production environment | build.gradle, flavor dirs, signingconfigs |
✅ | ios | xcode version | compatibilityversion |
✅ | ios | podfile | podfile |
✅ | ios | switching between development and production environment | xcconfig, podfile |
✅ | firebase | [android] switching between development and production google-service.json using flavors | development and production |
✅ | firebase | [ios] switching between development and production googleservice-info.plist using run script | copy_google_service.sh, development and production |
✅ | firebase auth | signin, signout | auth_data_source_impl.dart |
✅ | firebase crashlytics | crash reports | main.dart |
✅ | firebase performance | network monitoring with dio_firebase_performance | app_dio.dart |
architecture
working status | category | description | codes |
---|---|---|---|
✅ | base | using riverpod + hooks + changenotifier + mvvm | news_page.dart, news_view_model.dart, news_repository.dart, news_data_source.dart |
✅ | networking | using dio and retofit | app_dio.dart, news_data_source.dart |
✅ | data | using freezed | model classes |
✅ | constants | define constants and route names | constants.dart |
✅ | localization | switching between two languages with intl package | *.arb |
✅ | error handling | using result pattern – a value that represents either a success or a failure, including an associated value in each case. | result.dart, news_repository_impl.dart, home_page.dart |
ui
working status | category | description | codes |
---|---|---|---|
✅ | theme | staticly switch between light and dark themes | app_theme.dart |
✅ | font | using google font | app_theme.dart |
✅ | transition | simple animation between screens using hero | article_item.dart, detail_page.dart |
testing
working status | category | description | codes |
---|---|---|---|
✅ | api(repositories) | using mocktail | view_mode_test.dart |
✅️ | ui | using mocktail | widget_test.dart |
✅ | coverage reports | send the report to codecov on ci | codecov.yml, codecov.sh, flutte-ci.yml |
ci
working status | category | description | codes |
---|---|---|---|
✅ | git | git hooks for format and analyze | package.json, makefile |
✅ | git | .gitignore settings | .gitignore |
✅ | build | using codemagic | codemagic.yaml |
✅ | build | using bitrise | bitrise.yml |
✅ | build | using github actions | .github/workflows/flutter-ci.yml |
getting started
setup
$ make setup
$ export path="$path":"$home/.pub-cache/bin" # add your run-commands (.zshrc, .bashrc, etc)
$ make dependencies
$ make build-runner
how to add assets(images..)
- add assets
- run fluttergen
how to add localizations
- edit *.arb files.
- run generate the
flutter pub get
make .apk and .ipa file
android
$ make build-android-dev
$ make build-android-prd
ios
$ make build-ios-dev
$ make build-ios-prd
run app
$ make run-dev
$ make run-prd
special thanks.
contributors
Comments are closed.