π― flutter_blueprint
Enterprise-grade Flutter app scaffolding CLI - generates production-ready Flutter projects with clean architecture, advanced state management options, and release-ready workflows.
π± Note: CLI runs on desktop (Windows/Linux/macOS) to generate Flutter projects that support all platforms (Android, iOS, Web, Desktop).
π What's New in v3.0
Latest release highlights:
| Enhancement | Description |
|---|---|
| π©Ί Doctor Command | analyze, pub outdated, and fix --dry-run with an action plan |
| π‘οΈ Release Security Preset | Obfuscation, split debug symbols, and symbolication workflow docs |
| π Compliance Modernization | MASVS control-group checklist with MASWE-oriented mappings |
| π Observability Baseline | Sentry release/environment tagging scaffolding when selected |
| π Dependency Guardrails | Dependabot + dependency drift workflow for GitHub CI |
| β Expanded Regression Tests | Matrix-style generation tests covering high-risk combinations |
See CHANGELOG.md for complete details.
π Quick Start
Installation
# Windows (PowerShell)
iex (irm 'https://rawgit.flutter-io.cn/chirag640/flutter_blueprint-Package/main/scripts/install.ps1')
# macOS / Linux
dart pub global activate flutter_blueprint
Create a Project
# Interactive wizard (recommended)
flutter_blueprint init
# Quick mode with options
flutter_blueprint init my_app --state riverpod --api --theme --tests
β¨ Key Features
| Category | Features |
|---|---|
| Architecture | Clean architecture, 60+ files, feature-based structure |
| Complete Features | Home (API + pagination), Auth (login/register), Profile (view/edit), Settings (theme/prefs) |
| State Management | Provider, Riverpod, BLoC, or GetX |
| GraphQL | Optional GraphQL layer β graphql_flutter or Ferry client |
| API Layer | Dio + Auth/Retry/Logger/Security/RateLimit interceptors, Universal API Configurator |
| Storage | LocalStorage + SecureStorage + Hive caching with JSON serialization |
| Security | OWASP headers, error sanitization, SSRF prevention, certificate pinning, rate limiting |
| UI Components | Theme system, reusable widgets, Material 3 |
| DevOps | GitHub Actions, GitLab CI, Azure Pipelines |
| Extras | Pagination, Analytics, Security utilities, i18n |
π― Production-Ready Features
When you generate a project with --api flag, you get complete working features with zero placeholders:
π Home Feature
- API Integration: Real data from JSONPlaceholder demo API
- Pagination: Load more with infinite scroll
- Caching: 1-hour TTL with offline-first pattern
- UI: Pull-to-refresh, loading states, error handling
π Authentication Feature (with --api)
- Login & Register: Complete forms with validation
- Token Management: JWT access + refresh tokens, secure storage
- Auto-login: Checks auth status on app startup
- UI: Beautiful login/register pages, error messages, loading states
π€ Profile Feature (with --api)
- View Profile: Display user info with avatar
- Edit Profile: Update name, bio, phone, location
- Avatar Upload: Image picker integration (demo mode)
- Caching: Offline-first with 1-hour TTL
βοΈ Settings Feature (always included)
- Theme Switcher: Light, Dark, System modes
- Notifications: Toggle push notifications
- Biometrics: Enable/disable biometric login
- Account: Profile link, Logout (if auth enabled)
- About: Version, Terms, Privacy Policy
- Data Management: Clear all cached data
π Security Features
flutter_blueprint generates enterprise-grade security out of the box:
π‘οΈ Security Headers
- X-Content-Type-Options: Prevents MIME-sniffing attacks
- X-Frame-Options: Clickjacking protection (DENY)
- X-XSS-Protection: Legacy XSS protection layer
- Strict-Transport-Security: Forces HTTPS (1 year + subdomains)
- Cache-Control: Prevents sensitive data caching
π Certificate Pinning
Prevent MITM attacks with SHA-256 fingerprint validation:
final dio = ApiClient(
baseUrl: 'https://api.example.com',
certificatePins: ['sha256/AAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAAA='],
).dio;
π¦ Rate Limiting
Client-side protection with 60 requests/minute per endpoint:
- Automatic retry-after calculation
- Rolling window tracking
- Prevents API abuse
π§Ή Error Sanitization
Security interceptor automatically removes:
- File paths (Windows/Unix)
- IP addresses (IPv4/IPv6)
- Long tokens (32+ characters)
- SSRF prevention (blocks localhost in production)
β Security Validation
Built-in security audit helper:
final result = SecurityConfig.checkSecurityConfiguration(dio);
print('Security checks: ${result.passed} passed, ${result.issues.length} issues');
π οΈ CLI Commands
init - Create New Project
flutter_blueprint init <app_name> [options]
| Flag | Description |
|---|---|
--state <choice> |
State management: provider, riverpod, bloc, getx |
--graphql-client |
GraphQL client: none (default), graphql_flutter, ferry |
--platforms <list> |
Target: mobile, web, desktop, all |
--ci <provider> |
CI/CD: github, gitlab, azure |
--api |
Include API client (prompts for backend type) |
--theme |
Include theme system |
--env |
Include environment config |
--tests |
Include test scaffolding |
--hive |
Include Hive offline caching |
--pagination |
Include pagination support |
--analytics <provider> |
Analytics: firebase, sentry |
--with-ai-governance |
Scaffold AI governance guardrails |
--ai-governance-level |
Governance depth: minimal, standard, full |
--ai-ci-mode |
AI policy CI mode: advisory, mixed, blocking |
--ai-owner |
Owner handle for generated CODEOWNERS entries |
doctor - Health Report and Action Plan
flutter_blueprint doctor [path] [--strict] [--verbose]
Runs:
dart analyzedart pub outdateddart fix --dry-run
Then prints an actionable report with recommended next steps for dependency drift, analyzer failures, and safe autofix opportunities.
π API Backend Presets
When --api is enabled, choose from built-in presets:
- Modern REST - HTTP 200 + JSON data
- Legacy .NET - success: true/false pattern
- Laravel - data wrapper, message field
- Django REST - results array, detail errors
- Custom - manual configuration
add feature - Add Features to Existing Project
flutter_blueprint add feature <name> [--api] [--no-data] [--no-domain]
π Generated Structure
my_app/
βββ lib/
β βββ main.dart
β βββ app/app.dart
β βββ core/
β β βββ api/ # API client + interceptors
β β βββ config/ # App config + env loader
β β βββ errors/ # Exceptions + failures
β β βββ routing/ # Router + guards
β β βββ storage/ # Local + secure storage
β β βββ theme/ # Colors, typography, themes
β β βββ utils/ # Logger, validators, extensions
β β βββ widgets/ # Reusable UI components
β βββ features/ # Feature modules
βββ test/ # Test scaffolding
βββ pubspec.yaml
πΎ Data Layer Features
Smart Caching
Production-ready cache implementation with SharedPreferences:
// Auto-generated cache methods
final items = await localDataSource.getCached(); // Returns List<T> or null
await localDataSource.cache(items); // JSON serialization
await localDataSource.clearCache(); // Clear cache
- Automatic JSON serialization/deserialization
- Error recovery (auto-clears corrupted cache)
- Type-safe operations
Auth Token Management
Flexible token handling with callback-based interceptors:
final dio = ApiClient(
baseUrl: 'https://api.example.com',
getToken: () async => await storage.getToken(),
refreshToken: () async => await authService.refresh(),
).dio;
- Automatic 401 handling with token refresh
- Request retry after refresh
- Works with any auth strategy (OAuth, JWT, custom)
Offline Sync
Hive-based offline support with API synchronization:
- Queue changes while offline
- Auto-sync when connection restored
- Conflict resolution strategies
π€ Team Collaboration
Share configurations across your team:
# Import team config
flutter_blueprint share import ./company_standard.yaml
# Create project from config
flutter_blueprint init my_app --from-config company_standard
π Documentation
- Architecture Guide - Deep dive into architecture decisions
- Example Usage - Programmatic API examples
- Contributing Guide - How to contribute
- Changelog - Version history
π License
MIT License - see LICENSE
π¬ Support
- π§ Email: chaudharychirag640@gmail.com
- π GitHub Issues
- π¬ Discussions
Made with β€οΈ for the Flutter community β