Clean Architecture Project Sample (Project template).
- Go to
core/app/app_initialization.dart
and put your initializations ininitApp()
function; - Modify
core/arch/data/remote/error/default_api_error.dart
to your default api response model;
- GetIt - service locator (DI)
- Screen Util - adaptive UI tools
- Go Router - navigation
- Json Annotation - code generation based for JSON parsing
- Freezed - code genearion of data classes
- Hive - database
- Dio - Http client
- Bloc - state management
- Shared Preferences - key-value storage
- Set
sonar.projectKey
insonar-project.properties
- Replace main in
only: - main
to your main branch name in.gitlab-ci.yml
DefaultApiError
is default api error body - so change it to your purposes.DioConst
is base api url location - so change it to your purposes.
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
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
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
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
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
- 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
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*