flutter_blueprint 0.2.0-dev.2
flutter_blueprint: ^0.2.0-dev.2 copied to clipboard
Smart Flutter app scaffolding CLI with architecture, theming, routing, and environment handling built-in.
0.3.0-dev.1 (Current) #
๐ฅ NEW: Incremental Feature Generation - The Killer Feature! #
What's New:
- โ
add featurecommand - Generate features incrementally in existing projects - โ
Smart state management detection - Automatically generates Provider/Riverpod/Bloc files based on
blueprint.yaml - โ Clean architecture scaffolding - Creates data/domain/presentation layers
- โ
Automatic router integration - Injects routes into
app_router.dart - โ Selective layer generation - Choose which layers to generate with flags
- โ
API integration support - Include remote data sources with
--api - โ
Router skip option - Use
--no-routerto skip automatic router updates
Usage:
# Full feature with all layers
flutter_blueprint add feature auth
# Only presentation layer
flutter_blueprint add feature settings --presentation --no-data --no-domain
# With API integration
flutter_blueprint add feature products --api
# Skip router update
flutter_blueprint add feature profile --no-router
Generated Structure (example: auth):
lib/features/auth/
โโโ data/
โ โโโ models/auth_model.dart
โ โโโ datasources/
โ โ โโโ auth_remote_data_source.dart # if --api
โ โ โโโ auth_local_data_source.dart
โ โโโ repositories/auth_repository_impl.dart
โโโ domain/
โ โโโ entities/auth_entity.dart
โ โโโ repositories/auth_repository.dart
โ โโโ usecases/
โ โโโ get_auth_list.dart
โ โโโ get_auth_by_id.dart
โ โโโ create_auth.dart
โ โโโ update_auth.dart
โ โโโ delete_auth.dart
โโโ presentation/
โโโ pages/auth_page.dart
โโโ widgets/auth_list_item.dart
โโโ [provider|riverpod|bloc]/ # Adapts to project's state management
State Management Adaptation:
| Project Type | Generated Files |
|---|---|
| Provider | feature_provider.dart (ChangeNotifier) |
| Riverpod | feature_provider.dart (StateNotifier + sealed states) |
| Bloc | feature_event.dart, feature_state.dart, feature_bloc.dart |
Flags:
--data/--no-data- Generate/skip data layer--domain/--no-domain- Generate/skip domain layer--presentation/--no-presentation- Generate/skip presentation layer--api- Include remote data source (Dio-based)--router/--no-router- Update/skip app_router.dart modification
Impact:
- 10-20x faster feature development
- Perfect consistency across all features
- Zero boilerplate - one command does everything
- Production-ready code generation
Validation:
- โ Tested with Provider, Riverpod, and Bloc templates
- โ Automatic router update working
- โ Generated 13-15 files per feature
- โ Clean architecture maintained
0.2.0-dev.3 #
๐ NEW: Multi-Template State Management Support #
What's New:
- โ Riverpod Template - Compile-time safe state management
- โ Multi-template architecture (Provider + Riverpod, Bloc coming soon)
- โ
Template selection via
--stateflag - โ All templates share professional core modules
Riverpod-Specific Features:
- ProviderScope wrapper in main.dart for dependency injection
- ConsumerWidget pattern for reactive UI
- StateNotifier with immutable state classes and
copyWith() - Global providers in
core/providers/app_providers.dart - Compile-time safety - catch errors before runtime
- Better testability - providers easily mocked with
ProviderContainer - Automatic disposal - no memory leaks
Usage:
# Generate Riverpod project
flutter_blueprint init my_app --state riverpod --theme --api
# Or use wizard (select Riverpod from menu)
flutter_blueprint init
Template Comparison:
| Feature | Provider | Riverpod |
|---|---|---|
| State Class | ChangeNotifier | StateNotifier |
| UI Widget | Consumer | ConsumerWidget + WidgetRef |
| State Updates | notifyListeners() | state = state.copyWith(...) |
| Dependency Injection | MultiProvider wrapper | ProviderScope + ref.watch() |
| Compile-Time Safety | โ | โ |
| Generated Files | 43 files | 42 files |
Dependencies:
flutter_riverpod: ^2.5.1- Riverpod state management
Validation:
- โ Generated 42 files with professional architecture
- โ 0 analyzer errors
- โ 9/9 tests passing
- โ Same core modules as Provider (API, Logger, Storage, Validators, etc.)
What's Next: Bloc template coming soon!
0.2.0-dev.2 #
โจ NEW: Interactive Wizard Mode #
Beautiful CLI Experience:
- โ Guided step-by-step project setup
- โ Arrow key navigation for state management selection
- โ Multi-select checkboxes for features (spacebar to toggle)
- โ Configuration preview before generation
- โ Smart validation (prevents Dart reserved words)
- โ Package name validation (lowercase with underscores)
- โ
Emoji-rich, colorful UI powered by
interactpackage
Usage:
# Launch wizard
flutter_blueprint init
# Or use quick mode
flutter_blueprint init my_app --state provider
Dependencies Added:
interact: ^2.2.0- Beautiful CLI interactions
0.2.0-dev.1 #
๐ MAJOR UPGRADE: Enterprise-Grade Professional Template #
BREAKING: Generated projects now include 43 files (up from 19) with production-ready patterns.
๐ New Professional Modules
Error Handling System ๐จ
- โ 9 custom exception classes (FetchDataException, UnauthorizedException, etc.)
- โ Clean architecture Failures with Equatable
- โ Type-safe error handling throughout
Production API Client ๐
- โ Enhanced Dio client with generic methods (GET/POST/PUT/DELETE)
- โ AuthInterceptor - auto-add JWT tokens
- โ RetryInterceptor - exponential backoff retry logic
- โ Enhanced LoggerInterceptor with structured logging
- โ ApiResponse
Professional Logger ๐
- โ AppLogger with 5 levels (debug/info/warning/error/success)
- โ Tag-based filtering for modules
- โ Emoji-prefixed output for better readability
- โ Stack trace support for errors
Storage Layers ๐พ
- โ LocalStorage - SharedPreferences wrapper with type safety
- โ SecureStorage - FlutterSecureStorage wrapper for tokens
- โ Singleton pattern implementation
- โ Built-in error handling and logging
Form Validators โ
- โ 7 production-ready validators (email, password, phone, required, minLength, maxLength, numeric)
- โ Consistent error messages
- โ 8 unit tests with 100% coverage
- โ Easy to extend for custom validators
Reusable Widget Library ๐งฉ
- โ LoadingIndicator - customizable loading spinner
- โ ErrorView - error display with retry button
- โ EmptyState - empty list placeholders
- โ CustomButton - button with loading state
- โ CustomTextField - styled text field with validators
Extension Methods ๐ง
- โ String extensions (capitalize, isValidEmail, isBlank, removeWhitespace)
- โ DateTime extensions (formattedDate, isToday, isYesterday)
- โ BuildContext extensions (theme, colors, width, showSnackBar)
Constants & Configuration ๐
- โ AppConstants - timeouts, storage keys, pagination defaults
- โ ApiEndpoints - centralized API route management
- โ RouteNames - route constants
- โ AppColors - custom color palette
Network Monitoring ๐ก
- โ NetworkInfo - connectivity status checks
- โ Real-time connectivity stream
- โ Works on all platforms
Enhanced State Management ๐ฏ
- โ Professional Provider patterns with loading/error states
- โ Separated UI components (pages/widgets/providers)
- โ Consumer pattern with proper state handling
- โ Example feature with best practices
Test Infrastructure ๐งช
- โ Validator unit tests (8 tests, all passing)
- โ Test helpers for widget testing
- โ MockTail integration for testing
- โ CI/CD ready structure
๐ฆ New Dependencies
shared_preferences: ^2.2.3- Local storageflutter_secure_storage: ^9.2.2- Secure token storageequatable: ^2.0.5- Value comparison for Failuresconnectivity_plus: ^6.0.5- Network monitoringpretty_dio_logger: ^1.4.0- API logging
๐ Metrics
- Generated Files: 19 โ 43 (+126%)
- Core Modules: 5 โ 10 (+100%)
- Reusable Widgets: 0 โ 5
- API Interceptors: 1 โ 3 (+200%)
- Lines of Code: ~800 โ ~2,500+ (+200%)
- Analyzer Errors: 0
- Test Coverage: 100% (validators)
๐ก Impact
For Developers:
- Save 2-3 days of boilerplate setup
- Professional patterns from day one
- Focus on features, not infrastructure
For Teams:
- Consistent codebase across projects
- Reduced onboarding time
- Faster MVP delivery
For Enterprises:
- Enterprise-grade architecture
- Security patterns included
- Logging and monitoring ready
- Scalable structure
0.1.0-dev.1 #
Initial Development Release #
Core Features:
- โ
CLI-based project generation with
flutter_blueprint init - โ Interactive and flag-based configuration modes
- โ Provider state management template (mobile platform)
- โ Modular architecture with core/features folder structure
- โ Optional theme scaffolding (light/dark mode support)
- โ Optional localization setup (ARB files + intl)
- โ Optional environment configuration (.env support)
- โ Optional API client setup (Dio + interceptors)
- โ Optional test scaffolding (widget tests + mocktail)
- โ Auto-routing system with route guards
- โ
Blueprint manifest (
blueprint.yaml) for project tracking
Template Structure:
- Clean architecture with
core/,features/, andapp/layers - Type-safe configuration management
- Production-ready folder organization
- Best-practice imports and dependency injection
What's Next:
- Riverpod and Bloc templates
- Feature generation command (
flutter_blueprint add feature) - Web and desktop platform support
- Plugin system for optional modules
- CI/CD scaffold generation