Production-ready template for building cross-platform mobile applications with Flutter, Dart, Riverpod v2, Dio HTTP Client, and Reactive Forms.
Flutter Starter is a comprehensive mobile app template that implements modern architecture and best practices:
- Framework: Flutter with Dart for cross-platform development (iOS, Android, Web, macOS)
- State Management: Riverpod v2 for reactive and efficient state management
- HTTP Client: Dio for robust and interceptor-based API communication
- Forms: Reactive Forms for reactive form handling with validation
- Preview: Device Preview built-in for testing across multiple screen sizes
- Analysis: Comprehensive linting and code analysis tools
Use this starter for:
- Cross-platform mobile applications
- Rapid prototyping and MVP development
- Teams wanting Flutter best practices built-in
| Concern | Package |
|---|---|
| Framework | Flutter (stable) |
| Language | Dart >=3.0.0 |
| State Management | flutter_riverpod ^2.5.1 |
| HTTP Client | dio ^5.4.0 |
| Forms | reactive_forms ^17.0.0 |
| Device Preview | device_preview ^1.1.0 |
| Version Manager | FVM (Flutter Version Management) |
- Flutter: Latest stable version (via FVM recommended)
- Dart: >=3.0.0
- FVM: Install FVM
- Xcode: v14+ (for iOS development)
- Android Studio: Latest (for Android development)
git clone <repository-url>
cd flutter-starterRecommended approach using FVM for version management:
fvm install
fvm use stableWithout FVM, ensure Flutter stable version is installed:
flutter --versionWith FVM:
fvm flutter pub getWithout FVM:
flutter pub getThe application uses API_BASE_URL for all HTTP requests.
Run with the --dart-define flag:
flutter run --dart-define=API_BASE_URL=https://api.example.comNote: Without this flag, all API requests will fail due to empty API_BASE_URL.
flutter run -d chrome --dart-define=API_BASE_URL=https://api.example.comflutter run -d macos --dart-define=API_BASE_URL=https://api.example.comflutter run -d android --dart-define=API_BASE_URL=https://api.example.comflutter run -d ios --dart-define=API_BASE_URL=https://api.example.comlib/
├── features/
│ └── {featureName}/
│ ├── types/ # Data models & state shape
│ ├── states/ # Riverpod Notifier (client state)
│ ├── services/ # HTTP calls via DioClient
│ ├── controllers/ # AsyncNotifier (async logic)
│ └── widgets/ # UI layer (screens & components)
├── shared/
│ ├── services/ # Shared services (DioClient, etc)
│ ├── widgets/ # Reusable UI widgets
│ ├── utils/ # Helper functions
│ └── constants/ # App constants
└── main.dart # App entry point
| Command | Description |
|---|---|
flutter pub get |
Install dependencies |
flutter run |
Run app (device preview) |
flutter test |
Run unit & widget tests |
dart analyze --fatal-infos |
Static analysis |
dart format --set-exit-if-changed . |
Code formatting |
flutter build web |
Build for web |
flutter build ios |
Build for iOS |
flutter build android |
Build for Android |
The application includes device_preview package for multi-device testing.
When running in non-release mode, a preview panel automatically appears — select different devices from the dropdown to see how your app looks across various screen sizes.
Note: Device Preview is automatically disabled for release builds.
flutter test# Static analysis
dart analyze --fatal-infos
# Format code
dart format --set-exit-if-changed .Complete documentation for architecture, naming conventions, and best practices is available in CODE.md.
Key Topics:
- Naming conventions (functions, files, folders)
- Layer structure (Types, States, Services, Controllers, Widgets)
- Riverpod provider patterns
- Dio HTTP client usage
- Reactive Forms implementation
- Widget composition best practices
- State management patterns
- Fork this repository
- Create a feature branch:
git checkout -b feature/your-feature-name - Commit your changes:
git commit -m 'feat: add your feature' - Push to the branch:
git push origin feature/your-feature-name - Open a Pull Request
MIT License - see LICENSE file for details.
Developed by Dzikri Alan's Team