This project follows a specific structure and template for Flutter app creation. It's based on a template that originally utilized a robust CLI, following a block architecture. However, I adapted it to use Riverpod, making significant modifications to align it with Riverpod's principles. Additionally, the template includes numerous predefined widgets, which I customize based on project requirements. I adhere to Andrea's "Feature-first" approach, with my own modifications. I don't rely on Riverpod code generation and instead heavily utilize StateNotifier over other notifiers. So, happy coding to me!
.
βββ .DS_Store
βββ .dart_tool
β βββ .DS_Store
β βββ dartpad
β βββ extension_discovery
β βββ flutter_build
β βββ flutter_gen
β βββ package_config.json
β βββ package_config_subset
β βββ version
βββ .env
βββ .env-example.txt
βββ .flutter-plugins
βββ .flutter-plugins-dependencies
βββ .github
β βββ PULL_REQUEST_TEMPLATE.md
β βββ cspell.json
β βββ dependabot.yaml
β βββ workflows
βββ .gitignore
βββ .vscode
β βββ extensions.json
β βββ launch.json
βββ README.md
βββ analysis_options.yaml
βββ android
β βββ .DS_Store
β βββ .gitignore
β βββ .gradle
β βββ app
β βββ build.gradle
β βββ gradle
β βββ gradle.properties
β βββ gradlew
β βββ gradlew.bat
β βββ local.properties
β βββ settings.gradle
βββ assets
βββ build
β βββ .DS_Store
β βββ .last_build_id
β βββ 38042a41806411273a1a36c629ba9713.cache.dill.track.dill
β βββ 39f4bf50ad275767c79aa66def67de4c
β βββ 8f66b8507f29113a13ef8e9654d2db8a
β βββ app
β βββ flutter_image_compress_common
β βββ flutter_plugin_android_lifecycle
β βββ fluttertoast
β βββ image_picker_android
β βββ location
β βββ path_provider_android
β βββ sqflite
β βββ url_launcher_android
βββ coverage_badge.svg
βββ ios
β βββ .DS_Store
β βββ .gitignore
β βββ Flutter
β βββ Podfile
β βββ Runner
β βββ Runner.xcodeproj
β βββ Runner.xcworkspace
β βββ RunnerTests
βββ l10n.yaml
βββ lib
β βββ .DS_Store
β βββ app
β βββ bootstrap.dart
β βββ core
β βββ features
β βββ l10n
β βββ main_development.dart
β βββ main_production.dart
β βββ main_staging.dart
βββ packages
β βββ .DS_Store
β βββ app_ui
β βββ app_utils
βββ pubspec.lock
βββ pubspec.yaml
βββ test
βββ web
β βββ favicon.png
β βββ icons
β βββ index.html
β βββ manifest.json
βββ windows
βββ .DS_Store
βββ .gitignore
βββ CMakeLists.txt
βββ flutter
βββ runner
Generated by the Very Good CLI π€
A Very Good Project created by Very Good CLI.
This project contains 3 flavors:
-
development
-
staging
-
production
To run the desired flavor either use the launch configuration in VSCode/Android Studio or use the following commands:
# Development
$ flutter run --flavor development --target lib/main_development.dart
# Staging
$ flutter run --flavor staging --target lib/main_staging.dart
# Production
$ flutter run --flavor production --target lib/main_production.dart
*this app works on iOS, Android, Web, and Windows.
# Development
$ flutter build apk --flavor development --target lib/main_development.dart
# Staging
$ flutter build apk --flavor staging --target lib/main_staging.dart
# Production
$ flutter build apk --flavor production --target lib/main_production.dart
To run all unit and widget tests use the following command:
$ flutter test --coverage --test-randomize-ordering-seed random
To view the generated coverage report you can use lcov.
# Generate Coverage Report
$ genhtml coverage/lcov.info -o coverage/
# Open Coverage Report
$ open coverage/index.html
This project relies on flutter_localizations and follows the official internationalization guide for Flutter.
- To add a new localizable string, open the
app_en.arb
file atlib/l10n/arb/app_en.arb
.
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
}
}
- Then add a new key/value and description
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
},
"helloWorld": "Hello World",
"@helloWorld": {
"description": "Hello World Text"
}
}
- Use the new string
import 'package:your_project/l10n/l10n.dart';
@override
Widget build(BuildContext context) {
final l10n = context.l10n;
return Text(l10n.helloWorld);
}
Update the CFBundleLocalizations
array in the Info.plist
at ios/Runner/Info.plist
to include the new locale.
...
<key>CFBundleLocalizations</key>
<array>
<string>en</string>
<string>es</string>
</array>
...
- For each supported locale, add a new ARB file in
lib/l10n/arb
.
βββ l10n
β βββ arb
β β βββ app_en.arb
β β βββ app_es.arb
- Add the translated strings to each
.arb
file:
app_en.arb
{
"@@locale": "en",
"counterAppBarTitle": "Counter",
"@counterAppBarTitle": {
"description": "Text shown in the AppBar of the Counter Page"
}
}
app_es.arb
{
"@@locale": "es",
"counterAppBarTitle": "Contador",
"@counterAppBarTitle": {
"description": "Texto mostrado en la AppBar de la pΓ‘gina del contador"
}
}
To use the latest translations changes, you will need to generate them:
- Generate localizations for the current project:
flutter gen-l10n --arb-dir="lib/l10n/arb"
Alternatively, run flutter run
and code generation will take place automatically.