A production-ready Flutter template with OAuth authentication, Async Redux state management, GoRouter navigation, and comprehensive utilities for rapid app development.
- β OAuth Authentication - Email/password + Google OAuth (Firebase optional)
- β Async Redux - Predictable state management with actions and reducers
- β GoRouter - Declarative navigation with auth guards
- β MVC Architecture - Feature-based organization with clear separation
- β Material Design 3 - Modern theming with light/dark/system modes
- β Hive Database - Offline-first local storage with type-safe models
- β API Service - HTTP client with automatic token refresh on 401
- β SharedPreferences - StorageHelper wrapper for simple key-value storage
- β Form Validators - Email, password, phone, credit card, and more
- β Pagination - Infinite scroll with state management
- β Pull-to-Refresh - RefreshableList widget with loading/error states
- β Image Handling - Picker, compression, cached network images
- β Connectivity - Network status monitoring with offline banner
- β Error Boundary - Global error handling with retry UI
- β Notifications - Local + push notification ready
- β Localization - i18n with ARB files (English, Spanish included)
- β Analytics - Pluggable analytics abstraction
- β Crash Reporting - Crashlytics/Sentry ready
- β Mason Bricks - Automated feature scaffolding
- β Build Flavors - Development, staging, production environments
- β Logging - Pretty console logs with AppLogger
- β Unit Tests - Tests for actions, validators, pagination
# Clone and enter the project
git clone <repository-url>
cd template
# Run interactive setup
./scripts/setup.shThe setup script will:
- Configure app name and bundle ID
- Set up API base URL
- Create environment files
- Run code generation
# Get dependencies
flutter pub get
# Rename your app
dart run rename setAppName --targets ios,android,web --value "Your App"
dart run rename setBundleId --targets ios,android --value "com.company.app"
# Run code generation
dart run build_runner build --delete-conflicting-outputs# Run with development config
./scripts/run.sh development
# Or standard run
flutter runlib/
βββ core/
β βββ config/ # Environment & flavor configuration
β βββ constants/ # Theme, API constants
β βββ router/ # GoRouter configuration
β βββ services/ # API, Hive, Analytics, Connectivity, etc.
β βββ store/ # Redux store & substates
β βββ utils/ # Validators, pagination, logging, storage
βββ features/
β βββ auth/ # Login, register, OAuth
β βββ counter/ # Demo feature
β βββ theme/ # Theme switching
βββ l10n/ # Localization ARB files
βββ shared/
βββ widgets/ # Reusable components
This template uses OAuth-first authentication (no Firebase required by default).
await context.dispatch(LoginAction(
email: '[email protected]',
password: 'password123',
));await context.dispatch(GetGoogleAuthUrlAction(
onSuccess: (url) => launchUrl(Uri.parse(url)),
onError: (error) => showError(error),
));In main_common.dart, set:
const bool useFirebaseAuth = true;π See AUTH.md for complete documentation.
mason make feature --name your_featureThis automatically creates:
- MVC structure (models, controllers, views)
- Hive integration with offline caching
- Route registration
- Redux state & actions
- API endpoints
- Unit tests
See DEVELOPMENT.md for step-by-step guide.
| File | Description |
|---|---|
| AUTH.md | Authentication flows, actions, endpoints |
| DEVELOPMENT.md | Development workflow, adding features |
| FLAVORS.md | Build flavors & environment configuration |
| NOTIFICATIONS.md | Push & local notifications setup |
| LOGGER.md | Logging utilities |
| FIREBASE_AUTH_SETUP.md | Firebase configuration (optional) |
# Run with environment
./scripts/run.sh development
./scripts/run.sh production
# Build
./scripts/build.sh production apk
./scripts/build.sh staging ios
# Code generation
dart run build_runner build --delete-conflicting-outputs
# Tests
flutter test
# Analyze
flutter analyzeTextFormField(
validator: Validators.compose([
Validators.required('Email is required'),
Validators.email(),
]),
)PaginatedListView<Item>(
state: paginatedState,
onLoadMore: () => dispatch(LoadMoreAction()),
onRefresh: () async => dispatch(RefreshAction()),
itemBuilder: (context, item, index) => ItemTile(item),
)ConnectivityBanner(
child: YourApp(),
)// Pick and compress
final file = await ImageService().pickWithDialog(context);
final compressed = await ImageService().compressImage(file);
// Display cached
AppNetworkImage(imageUrl: 'https://...', width: 100, height: 100)await AnalyticsService().logEvent('button_tap', {'button': 'submit'});
await AnalyticsEvents.featureUsed('dark_mode');This template is designed to work with cuisonenrico/be-template - a NestJS backend with OAuth, Supabase, and Redis.
MIT License