A Flutter project built on the Stacked framework — a powerful architecture solution for production-ready applications.
Stacked provides amazing solutions for dependency injection, state management, routing, and more. However, there are some must-have libraries that are incredibly handy in development and ones we use daily when building high-quality apps.
Stacked_plus includes these core libraries so you can get started building your next app quickly, without wasting time on setting up the base project structure.
More details about Stacked can be found here: Stacked Documentation
This project-specific startup flow is documented in Stacked startup logic.
| Library | Purpose | Link |
|---|---|---|
| Melos | Manage multi-package Flutter/Dart projects efficiently. See melos.yaml for available commands. |
melos.invertase.dev |
| FVM | Flutter Version Manager for consistent Flutter SDK usage across teams. | fvm.app |
| Husky | Git hooks to run checks and scripts before commits or pushes. | typicode.github.io/husky |
| total_lints | Standardized lints for cleaner, maintainable code. | pub.dev/packages/total_lints |
| Library | Purpose | Link |
|---|---|---|
| DevicePreview | Preview and test your app on multiple devices & resolutions. | pub.dev/packages/device_preview |
| flutter_flavor | Set up multiple app flavors (test/dev/prod) with 3 Google JSON configs. | pub.dev/packages/flutter_flavor |
| intl_utils | Generate localization code from .arb files. |
pub.dev/packages/intl_utils |
| flutter_localizations | Flutter’s built-in localization support. | api.flutter.dev/flutter/flutter_localizations |
| Library | Purpose | Link |
|---|---|---|
| firebase_analytics | Track user engagement and events. Setup with flutterfire configure. |
firebase.google.com/docs/analytics |
| firebase_crashlytics | Capture and report app crashes in real-time. | firebase.google.com/docs/crashlytics |
| Library | Purpose | Link |
|---|---|---|
| freezed_annotation | Immutable classes & union types for safer state management. | pub.dev/packages/freezed_annotation |
| hive | Lightweight, fast, NoSQL database for Flutter. | pub.dev/packages/hive |
| Library | Purpose | Link |
|---|---|---|
| logger | Simple, colorful, and formatted logging. | pub.dev/packages/logger |
| flutter_launcher_icons | Easily generate app launcher icons. | pub.dev/packages/flutter_launcher_icons |
| form_validation | Simplify form field validations. | pub.dev/packages/form_validation |
With Stacked_plus, you get a ready-to-use foundation that combines the power of Stacked with essential tools and libraries for building robust, scalable, and production-ready Flutter apps.
Add google-services in android/add
Firebase Web requires explicit FirebaseOptions. If the app throws
FirebaseOptions cannot be null when creating the default app, provide Firebase
Web config values with Dart defines:
flutter run -d chrome `
--dart-define=FIREBASE_API_KEY=your-api-key `
--dart-define=FIREBASE_APP_ID=your-app-id `
--dart-define=FIREBASE_MESSAGING_SENDER_ID=your-sender-id `
--dart-define=FIREBASE_PROJECT_ID=your-project-id `
--dart-define=FIREBASE_AUTH_DOMAIN=your-project.firebaseapp.com `
--dart-define=FIREBASE_STORAGE_BUCKET=your-project.appspot.com `
--dart-define=FIREBASE_MEASUREMENT_ID=your-measurement-idThe app reads those values in lib/app/firebase_config.dart. Until the required
web values are provided, the app skips Firebase on web and disables the Firebase
Analytics integration for the current run.
This is a Flutter project, so install the Flutter SDK first and add the
Flutter bin directory to your Windows PATH. That path provides both the
flutter command and Flutter's bundled dart command.
Verify the toolchain before running project commands:
flutter --version
dart --version
flutter doctorIf dart pub get prints dart : The term 'dart' is not recognized, the SDK is
not on PATH yet. For this project, prefer:
flutter pub getIf you use FVM, install it after Dart is available, then run Flutter commands through FVM:
dart pub global activate fvm
fvm install stable
fvm use stable
fvm flutter pub getThis project uses Melos for managing packages and development scripts.
Make sure you have Melos installed.
# Install Melos globally
dart pub global activate melos
# Optional: install Flutter with FVM
fvm install stable
fvm use stable
# Install dependencies & enable Git hooks
melos run init
#Install Husky
npm install husky --save-dev
Or
yarn add husky --dev
#Enable Enable Git hooks
npx husky install
# Run code generation
melos generate
# Run the app
fvm flutter run