Use this template as a kickstarter for building Flutter applications with a scalable structure. Please review and complete all TODOs before starting development.
You can use change_app_package_name to update your app's bundle identifiers.
Use flutter_flavorizr to create and manage app flavors.
To build a production APK using flavorizr:
flutter build apk --flavor prod -t lib/main.dartUse Flutter Riverpod Snippets by Robert Brunhage for VS Code to boost productivity.
Leverage code generation for providers.
📚 Riverpod Code Generation Docs
Use flutter_hooks with Riverpod to reduce boilerplate and avoid using StatefulWidget and setState.
Use json_serializable to generate serialization code for model classes.
Use flutter_gen to auto-generate asset references.
After adding assets, run:
fluttergen -b pubspec.yamlOpen User Settings (JSON) and paste the following configuration:
"[dart]": {
"editor.formatOnSave": true,
"editor.formatOnType": true,
"editor.rulers": [80],
"editor.selectionHighlight": false,
"editor.tabCompletion": "onlySnippets",
"editor.wordBasedSuggestions": "off",
"editor.inlayHints.enabled": "offUnlessPressed",
"editor.defaultFormatter": "Dart-Code.dart-code",
"editor.codeActionsOnSave": {
"source.fixAll": "explicit",
"source.fixAll.eslint": "explicit",
"source.organizeImports": "explicit"
}
},
"editor.formatOnSave": true,
"editor.codeActionsOnSave": {
"source.fixAll.eslint": "explicit"
}Always follow Dart and Flutter linter suggestions to keep code clean, consistent, and readable.
lib/
├── constants/ # All constants, enums, and shared values
├── gen/ # Auto-generated files (e.g. assets via flutter_gen)
├── models/ # Model classes, separated by feature
├── providers/ # Riverpod providers and notifiers, by feature
├── screens/ # UI screens, with 'Screen' suffix and feature folders
│ └── feature_name/
│ ├── feature_screen.dart
│ └── widgets/ # Feature-specific widgets
├── services/ # API and business logic services, by feature
├── utils/ # Shared utility functions
└── widgets/ # Global reusable widgets (e.g. shared buttons)
Move all reusable utility functions from the UI layer to the utils folder to improve reusability and maintainability across the project. Consider organizing them using extensions where appropriate (e.g., utils/theme/extension.dart).
If you're using an LLM (AI assistant) for code generation, clearly specify that you're using Riverpod and Flutter Hooks to ensure the generated code aligns with this template's structure and philosophy.
Happy coding! 💻🚀