flutter_blueprint 2.0.1 copy "flutter_blueprint: ^2.0.1" to clipboard
flutter_blueprint: ^2.0.1 copied to clipboard

Production-ready Flutter CLI scaffolding tool with multi-platform support, advanced state management (Provider/Riverpod/Bloc), universal API configurator, enterprise security (OWASP headers, certifica [...]

🎯 flutter_blueprint #

Enterprise-grade Flutter app scaffolding CLI β€” generates production-ready Flutter projects with 43+ professional files, complete architecture, and best practices.

Pub Version Pub Points Pub Likes License: MIT Flutter 3.38+ Dart 3.5+

πŸ“± Note: CLI runs on desktop (Windows/Linux/macOS) to generate Flutter projects that support all platforms (Android, iOS, Web, Desktop).

πŸŽ‰ What's New in v2.0 #

Major architectural improvements and production-ready features:

Enhancement Description
πŸ”₯ Complete Features Auth, Profile, Settings with full UI - zero placeholders
🏠 Smart Home Screen API-connected with pagination, caching, pull-to-refresh
πŸ” Full Authentication Login, Register, Token management, Auto-login, Secure storage
πŸ‘€ Profile Management View, Edit profile, Avatar upload, Offline-first caching
βš™οΈ Settings System Theme switcher, Notifications, Biometrics, Account management
πŸ”’ Enterprise Security OWASP-compliant headers, certificate pinning, SSRF prevention
🚦 Rate Limiting Client-side protection (60 req/min per endpoint)
πŸ’Ύ Smart Caching SharedPreferences + JSON serialization with error recovery
πŸ—οΈ Architecture Refactor Result types, command pattern, DI container
βœ… Testing 334 tests passing, 62.88% coverage

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, or Bloc
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 (v2.0+) #

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
--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
--security <level> Security: basic, standard, enterprise

πŸ”Œ 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 (v2.0+) #

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 v2.0 architecture
  • Example Usage - Programmatic API examples
  • Contributing Guide - How to contribute
  • Changelog - Version history

πŸ“„ License #

MIT License - see LICENSE

πŸ’¬ Support #


Made with ❀️ for the Flutter community ⭐

23
likes
0
points
84
downloads

Documentation

Documentation

Publisher

unverified uploader

Weekly Downloads

Production-ready Flutter CLI scaffolding tool with multi-platform support, advanced state management (Provider/Riverpod/Bloc), universal API configurator, enterprise security (OWASP headers, certificate pinning, rate limiting), smart caching, auth token management, offline-first architecture, and Material 3. Flutter 3.38 & Dart 3.10 compatible.

Repository (GitHub)
View/report issues

Topics

#cli #scaffolding #code-generation #flutter #architecture

License

unknown (license)

Dependencies

args, http, interact, mustache_template, path, pub_semver, yaml

More

Packages that depend on flutter_blueprint