/clean_arch_sample

Simple example of clean arch.

Primary LanguageDart

Clean Architecture Project Sample (Project template).

Setup Template

  • Go to core/app/app_initialization.dart and put your initializations in initApp() function;
  • Modify core/arch/data/remote/error/default_api_error.dart to your default api response model;

Technologies used in Example

SonarQube Setup

  • Set sonar.projectKey in sonar-project.properties
  • Replace main in only: - main to your main branch name in .gitlab-ci.yml

DO AFTER SETUP

  • DefaultApiError is default api error body - so change it to your purposes.
  • DioConst is base api url location - so change it to your purposes.

Build Runner

To generate classes:

flutter packages pub run build_runner build

Use the [watch] flag to watch the files' system for edits and rebuild as necessary.

flutter packages pub run build_runner watch

If you have conflicts use command:

flutter pub run build_runner build --delete-conflicting-outputs

Regenerate splash screen:

flutter pub run flutter_native_splash:create

Build

IOS

  • flutter build ios --release
  • flutter build ios --flavor dev --release -t lib/core/flavors/main_dev.dart
  • flutter build ios --flavor prod --release -t lib/core/flavors/main_prod.dart

Android

APK

  • flutter build apk
  • flutter build apk --flavor dev -t lib/core/flavors/main_dev.dart
  • flutter build apk --flavor prod -t lib/core/flavors/main_prod.dart

AAB

  • flutter build appbundle
  • flutter build appbundle --flavor dev -t lib/core/flavors/main_dev.dart
  • flutter build appbundle --flavor prod -t lib/core/flavors/main_prod.dart

run release

  • flutter run --release
  • flutter run --flavor dev --release -t lib/core/flavors/main_dev.dart
  • flutter run --flavor prod --release -t lib/core/flavors/main_prod.dart

update IOS repos:

  • Most common use case is after firebase libraries update cd ios && pod cache clean --all && pod repo update && pod update && cd .. && flutter clean && flutter pub get

flutter_launcher_icons

init flutter_launcher_icons

flutter pub run flutter_launcher_icons:main -f pubspec.yaml

run flutter_launcher_icons

flutter pub run flutter_launcher_icons:main

generate flutter_launcher_icons for both flavors

flutter pub run flutter_launcher_icons:main -f flutter_launcher_icons*