wasabeef/flutter-architecture-blueprints

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Dart

1,668

488 commits

updated Jun 6, 2022

See the code

README

Flutter Architecture Blueprints

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Documentation

Installation

Environment

iOS

  • iOS 13+

Android

  • Android 5.1+
    • minSdkVersion 22
  • targetSdkVersion 30

App architecture

Code Style

Assets, Fonts

If added some assets or fonts

Models

If added some models for api results

Localizations

If added some localizations (i.g. edited *.arb)

Git Commit message style

Code collections

Project settings

Working statusCategoryDescriptionCodes
✅DartDart versionpubspec.yaml
✅asdfasdf.tool-versions
✅DartSwitching between Development and Production environmentconstants.dart, runConfigurations, Makefile
✅DartLint / Analyzeanalysis_options.yaml
✅AndroidKotlin versionbuild.gradle
✅AndroidApk attributesbuild.gradle (compileSdkVersion, applicationId, minSdkVersion, targetSdkVersion)
✅AndroidSwitching between Development and Production environmentbuild.gradle, Flavor dirs, signingConfigs
✅iOSXcode versioncompatibilityVersion
✅iOSPodfilePodfile
✅iOSSwitching between Development and Production environmentxcconfig, Podfile
✅Firebase[Android] Switching between Development and Production google-service.json using flavorsdevelopment and production
✅Firebase[iOS] Switching between Development and Production GoogleService-Info.plist using run scriptcopy_google_service.sh, development and production
✅Firebase AuthSignIn, SignOutauth_data_source_impl.dart
✅Firebase CrashlyticsCrash Reportsmain.dart
✅Firebase PerformanceNetwork monitoring with dio_firebase_performanceapp_dio.dart

Architecture

Working statusCategoryDescriptionCodes
✅BaseUsing Riverpod + Hooks + ChangeNotifier + MVVMnews_page.dart, news_view_model.dart, news_repository.dart, news_data_source.dart
✅NetworkingUsing dio and Retofitapp_dio.dart, news_data_source.dart
✅DataUsing Freezedmodel classes
✅ConstantsDefine constants and route namesconstants.dart
✅LocalizationSwitching between two languages with Intl package*.arb
✅Error handlingUsing 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 statusCategoryDescriptionCodes
✅ThemeStaticly Switch between light and dark themesapp_theme.dart
✅FontUsing Google fontapp_theme.dart
✅TransitionSimple animation between screens using Heroarticle_item.dart, detail_page.dart

Testing

Working statusCategoryDescriptionCodes
✅API(Repositories)Using mocktailview_mode_test.dart
✅️UIUsing mocktailwidget_test.dart
✅Coverage reportsSend the report to Codecov on CIcodecov.yml, codecov.sh, flutte-ci.yml

CI

Working statusCategoryDescriptionCodes
✅GitGit hooks for format and analyzepackage.json, Makefile
✅Git.gitignore settings.gitignore
✅BuildUsing Codemagiccodemagic.yaml
✅BuildUsing Bitrisebitrise.yml
✅BuildUsing 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..)

  1. Add assets
  2. Run FlutterGen

How to add localizations

  1. Edit *.arb files.
  2. 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

android-studio
architecture
dart
flutter
xcode

wasabeef/flutter-architecture-blueprints

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Dart

1,668

488 commits

updated Jun 6, 2022

See the code

README

Flutter Architecture Blueprints

Flutter Architecture Blueprints is a project that introduces MVVM architecture and project structure approaches to developing Flutter apps.

Documentation

Installation

Environment

iOS

  • iOS 13+

Android

  • Android 5.1+
    • minSdkVersion 22
  • targetSdkVersion 30

App architecture

Code Style

Assets, Fonts

If added some assets or fonts

Models

If added some models for api results

Localizations

If added some localizations (i.g. edited *.arb)

Git Commit message style

Code collections

Project settings

Working statusCategoryDescriptionCodes
✅DartDart versionpubspec.yaml
✅asdfasdf.tool-versions
✅DartSwitching between Development and Production environmentconstants.dart, runConfigurations, Makefile
✅DartLint / Analyzeanalysis_options.yaml
✅AndroidKotlin versionbuild.gradle
✅AndroidApk attributesbuild.gradle (compileSdkVersion, applicationId, minSdkVersion, targetSdkVersion)
✅AndroidSwitching between Development and Production environmentbuild.gradle, Flavor dirs, signingConfigs
✅iOSXcode versioncompatibilityVersion
✅iOSPodfilePodfile
✅iOSSwitching between Development and Production environmentxcconfig, Podfile
✅Firebase[Android] Switching between Development and Production google-service.json using flavorsdevelopment and production
✅Firebase[iOS] Switching between Development and Production GoogleService-Info.plist using run scriptcopy_google_service.sh, development and production
✅Firebase AuthSignIn, SignOutauth_data_source_impl.dart
✅Firebase CrashlyticsCrash Reportsmain.dart
✅Firebase PerformanceNetwork monitoring with dio_firebase_performanceapp_dio.dart

Architecture

Working statusCategoryDescriptionCodes
✅BaseUsing Riverpod + Hooks + ChangeNotifier + MVVMnews_page.dart, news_view_model.dart, news_repository.dart, news_data_source.dart
✅NetworkingUsing dio and Retofitapp_dio.dart, news_data_source.dart
✅DataUsing Freezedmodel classes
✅ConstantsDefine constants and route namesconstants.dart
✅LocalizationSwitching between two languages with Intl package*.arb
✅Error handlingUsing 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 statusCategoryDescriptionCodes
✅ThemeStaticly Switch between light and dark themesapp_theme.dart
✅FontUsing Google fontapp_theme.dart
✅TransitionSimple animation between screens using Heroarticle_item.dart, detail_page.dart

Testing

Working statusCategoryDescriptionCodes
✅API(Repositories)Using mocktailview_mode_test.dart
✅️UIUsing mocktailwidget_test.dart
✅Coverage reportsSend the report to Codecov on CIcodecov.yml, codecov.sh, flutte-ci.yml

CI

Working statusCategoryDescriptionCodes
✅GitGit hooks for format and analyzepackage.json, Makefile
✅Git.gitignore settings.gitignore
✅BuildUsing Codemagiccodemagic.yaml
✅BuildUsing Bitrisebitrise.yml
✅BuildUsing 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..)

  1. Add assets
  2. Run FlutterGen

How to add localizations

  1. Edit *.arb files.
  2. 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

android-studio
architecture
dart
flutter
xcode

Project health

Overall

3.1/10

Maintained

0/10

Code review

0/10
OpenSSF Scorecard

Significant stargazers

Ryo Aoyama

1,017 followers · starred Aug 2020

Satoshi Hachiya

75 followers · starred Mar 2022