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

CLI tool for scaffolding Flutter apps with clean architecture. Generates production-ready projects for Android, iOS, Web, and Desktop with state management, routing, and theming.

๐ŸŽฏ flutter_blueprint #

Enterprise-grade Flutter app scaffolding CLI โ€” generates production-ready Flutter projects with 43+ professional files, complete architecture, authentication patterns, error handling, storage layers, and reusable widgets. Stop wasting hours on boilerplate โ€” start building features from day one.

Pub Version License: MIT Publish Quality

๐Ÿ“ฑ Important Note: This is a CLI tool that runs on your development machine (Windows, Linux, macOS) to generate Flutter projects. The generated projects support ALL platforms: Android, iOS, Web, and Desktop. The CLI itself uses terminal-based UI libraries and thus only runs on desktop platforms, but the apps it creates work everywhere!

๐Ÿš€ Why flutter_blueprint? #

Problem Traditional Approach flutter_blueprint Solution
flutter create gives bare bones Hours of manual setup 43+ files with pro patterns instantly
GitHub templates are opinionated & bloated Copy-paste, delete unused code Modular generation - only what you need
No professional error handling Build it yourself Custom exceptions + Failures out of the box
Basic HTTP setup missing interceptors Add Dio, configure manually Auth, Retry, Logger interceptors included
No reusable widgets Create from scratch Loading, Error, Empty states ready to use
Form validation boilerplate Write validators each time Email, password, phone validators built-in
Storage layer missing Mix SharedPrefs everywhere LocalStorage + SecureStorage wrappers
No proper logging print() statements everywhere Professional Logger with levels

flutter_blueprint is not just a template โ€” it's a smart code generator that creates production-grade architecture tailored to your choices.


โœจ Features #

Core Features #

Feature Description Generated Files
โšก One-command setup flutter_blueprint init my_app 42-43 files in seconds
๐Ÿงฑ Clean architecture Separation of concerns (core/, features/, app/) Professional folder structure
๐ŸŽฏ State management Provider, Riverpod, OR Bloc Choose your preferred pattern
๐ŸŽจ Theming system Material 3 with custom colors & typography AppTheme, AppColors, Typography
๐ŸŒ Internationalization ARB files + intl config ready en.arb, hi.arb, localization
๐Ÿ› ๏ธ Environment config Dev/Stage/Prod with .env support EnvLoader + .env.example
๐Ÿงญ Professional routing Route names, guards, centralized navigation AppRouter, RouteGuard, Routes
๐Ÿ“ฑ Multi-platform support Mobile, Web, Desktop - all in one project Universal or single-platform

Professional Add-ons (What Makes It Pro) #

Feature What You Get
๏ฟฝ Production API Client Dio + Auth/Retry/Logger interceptors + Generic methods (GET/POST/PUT/DELETE)
๐Ÿšจ Error Handling System 9 custom exception classes + Failures for clean architecture
๐Ÿ“ Professional Logger AppLogger with debug/info/warning/error/success levels
โœ… Form Validators Email, password, phone, required, minLength, maxLength, numeric
๐Ÿ’พ Storage Layers LocalStorage (SharedPreferences wrapper) + SecureStorage (tokens)
๏ฟฝ Reusable Widgets LoadingIndicator, ErrorView, EmptyState, CustomButton, CustomTextField
๐ŸŒ Network Monitoring NetworkInfo with connectivity checks
๏ฟฝ Extensions & Utils String, DateTime, Context extensions + Constants
๐Ÿงช Professional Tests Validator tests, test helpers, widget tests
๐Ÿ“ Smart File Organization Constants (endpoints, app), Errors, Network, Utils, Widgets

DevOps Integration (NEW in v0.5.0!) #

Feature What You Get
๐Ÿš€ CI/CD Scaffold Generation GitHub Actions, GitLab CI, or Azure Pipelines - ready on first commit
โœ… Automated Quality Gates Flutter analyze, dart format check, and automated tests
๐Ÿ“Š Coverage Reporting Code coverage tracking with Codecov/built-in reports
๐Ÿ—๏ธ Multi-Platform Builds Automated Android APK + iOS IPA generation
๐Ÿ”ฅ Deployment Templates Firebase App Distribution integration ready to use

๐Ÿ“ฆ Installation #

dart pub global activate flutter_blueprint

Then use it anywhere:

flutter_blueprint init my_app

Local Execution #

dart run flutter_blueprint init my_app

๐ŸŽฌ Quick Start #

Just run without arguments for a beautiful guided experience:

flutter_blueprint init

What happens:

๐ŸŽฏ Welcome to flutter_blueprint!
   Let's create your Flutter app with professional architecture.

โœ” ๐Ÿ“ฑ App name ยท my_awesome_app

โœ” ๐ŸŽฏ Choose state management ยท provider
   โ€ข Provider (ChangeNotifier, easy to learn)
   โ€ข Riverpod (Compile-time safe, better testability) โ† NEW!
   โ€ข Bloc (Event-driven, coming soon)
   [Use โ†‘โ†“ arrow keys, Enter to select]

โœ” โœจ Select features to include (use space to select, enter to confirm)
   โœ“ Theme system (Light/Dark modes)
   โœ“ Localization (i18n support)
   โœ“ Environment config (.env)
   โœ“ API client (Dio + interceptors)
   โœ“ Test scaffolding

๐Ÿ“‹ Configuration Summary:
   App name: my_awesome_app
   State management: provider
   Theme: โœ…
   Localization: โœ…
   Environment: โœ…
   API client: โœ…
   Tests: โœ…

โœ” ๐Ÿš€ Ready to generate your app? ยท yes

๐Ÿš€ Generating project structure...
โœ… Generated 43 files successfully!

Features:

  • ๐ŸŽจ Beautiful UI with emojis and colors
  • โŒจ๏ธ Arrow key navigation for selections
  • โ˜‘๏ธ Multi-select checkboxes for features (spacebar to toggle)
  • โœ… Smart validation (prevents reserved words, invalid names)
  • ๐Ÿ“‹ Configuration preview before generation

โšก Quick Mode (For Experienced Users) #

Skip the wizard by providing the app name:

flutter_blueprint init my_app

Add flags for full control:

# Provider template (classic ChangeNotifier pattern)
flutter_blueprint init my_app \
  --state provider \
  --theme \
  --env \
  --api \
  --tests

# Riverpod template (compile-time safe with StateNotifier)
flutter_blueprint init my_app \
  --state riverpod \
  --theme \
  --env \
  --api \
  --tests \
  --no-localization

# With CI/CD configuration
flutter_blueprint init my_app --ci github
flutter_blueprint init my_app --state riverpod --ci gitlab
flutter_blueprint init my_app --state bloc --ci azure

# Multi-platform support (NEW!)
flutter_blueprint init my_app --platforms mobile,web
flutter_blueprint init my_app --platforms all --state bloc
flutter_blueprint init my_desktop_app --platforms desktop --state riverpod

Hybrid Mode (Mix Both) #

flutter_blueprint init my_app --state riverpod
# Prompts for remaining options

๏ฟฝ Multi-Platform Support (NEW in v0.4.0!) #

Build apps that run on mobile, web, AND desktop from a single codebase! flutter_blueprint now generates universal multi-platform projects with responsive layouts, adaptive navigation, and platform-specific optimizations.

Quick Start #

# Mobile + Web
flutter_blueprint init my_app --platforms mobile,web --state bloc

# All platforms (universal app)
flutter_blueprint init my_app --platforms all --state riverpod

# Desktop only
flutter_blueprint init my_desktop_app --platforms desktop --state provider

Platform Options #

Option Description Generated Files
--platforms mobile iOS & Android only (default) Standard mobile project
--platforms web Web application only web/index.html, PWA manifest, URL strategy
--platforms desktop Windows, macOS, Linux Window management, desktop optimizations
--platforms mobile,web Multi-platform project (mobile + web) Responsive layouts, adaptive UI
--platforms all Universal app (mobile + web + desktop) Complete multi-platform solution

Interactive Multi-Select #

In wizard mode, select multiple platforms with checkboxes:

๐Ÿ’ป Choose target platforms (space to select, enter to confirm):
[x] Mobile (iOS & Android)
[x] Web
[x] Desktop (Windows, macOS, Linux)

What Gets Generated for Multi-Platform #

Universal Entry Points:

lib/
โ”œโ”€โ”€ main.dart              # Universal router (detects platform)
โ”œโ”€โ”€ main_mobile.dart       # Mobile-specific initialization
โ”œโ”€โ”€ main_web.dart          # Web-specific initialization (URL strategy)
โ””โ”€โ”€ main_desktop.dart      # Desktop-specific initialization (window manager)

Responsive & Adaptive Components:

lib/core/responsive/
โ”œโ”€โ”€ breakpoints.dart           # Mobile/Tablet/Desktop breakpoints
โ”œโ”€โ”€ responsive_layout.dart     # Responsive widget (adapts to screen size)
โ”œโ”€โ”€ adaptive_scaffold.dart     # Adaptive navigation (bottom nav โ†’ rail โ†’ drawer)
โ””โ”€โ”€ responsive_spacing.dart    # Responsive padding & spacing helpers

lib/core/utils/
โ””โ”€โ”€ platform_info.dart         # Platform detection utilities

Platform-Specific Files:

  • Web: web/index.html, web/manifest.json (PWA-ready)
  • Desktop: Window configuration, title bar customization

Smart Dependency Management #

Dependencies are automatically added based on selected platforms:

# Common (all platforms)
dependencies:
  # Responsive & sizing (recommended)
  flutter_screenutil: ^5.7.1

  # Web-specific
  url_strategy: ^0.3.0

  # Desktop-specific
  window_manager: ^0.4.3
  path_provider: ^2.1.5

Responsive Features #

Breakpoints:

// The generated responsive utilities use flutter_screenutil and LayoutBuilder.
// Example breakpoint helpers are provided in `core/config/responsive_config.dart`.
if (Breakpoints.isMobile(context)) {
  // Show mobile layout
} else if (Breakpoints.isTablet(context)) {
  // Show tablet layout
} else {
  // Show desktop layout
}

Responsive Layouts:

ResponsiveLayout(
  mobile: MobileView(),    // < 768px
  tablet: TabletView(),    // 768px - 1280px
  desktop: DesktopView(),  // >= 1280px
)

Adaptive Navigation:

  • Mobile: Bottom navigation bar
  • Tablet: Navigation rail
  • Desktop: Side drawer/rail

Platform Detection #

if (PlatformInfo.isWeb) {
  // Web-specific code
} else if (PlatformInfo.isDesktop) {
  // Desktop-specific code
} else if (PlatformInfo.isMobile) {
  // Mobile-specific code
}

Running Multi-Platform Projects #

# Mobile
flutter run -d <device-id>

# Web
flutter run -d chrome

# Desktop
flutter run -d windows  # or macos, linux

Building for Production #

# Mobile
flutter build apk        # Android
flutter build ios        # iOS

# Web
flutter build web

# Desktop
flutter build windows    # Windows
flutter build macos      # macOS
flutter build linux      # Linux

When to Use Multi-Platform #

โœ… Use multi-platform when:

  • Building web + mobile versions of the same app
  • Need desktop companion app for your mobile app
  • Want to maximize code reuse across platforms
  • Building internal tools that need to run everywhere

โŒ Use single-platform when:

  • Platform-specific features are critical (AR, NFC, etc.)
  • Performance is absolutely critical
  • Simple mobile-only app
  • Heavy platform-specific UI requirements

๐Ÿš€ CI/CD Integration #

Generate production-ready CI/CD configurations with a single flag. Your project will be ready for automated testing and deployment from day one!

Quick Start #

# GitHub Actions
flutter_blueprint init my_app --ci github

# GitLab CI
flutter_blueprint init my_app --ci gitlab

# Azure Pipelines
flutter_blueprint init my_app --ci azure

What Gets Generated #

Provider File Pipeline Stages
GitHub .github/workflows/ci.yml Analyze โ†’ Test โ†’ Build Android โ†’ Build iOS
GitLab .gitlab-ci.yml analyze โ†’ test โ†’ build:android โ†’ build:ios
Azure azure-pipelines.yml Analyze Stage โ†’ Test Stage โ†’ Build Stage (Android + iOS)

Pipeline Features #

All generated CI/CD configurations include:

  • โœ… Code Quality: flutter analyze + dart format checks
  • ๐Ÿงช Automated Testing: Unit tests with coverage reporting
  • ๐Ÿ“ฑ Android Build: APK generation with artifact upload
  • ๐ŸŽ iOS Build: IPA generation (with codesigning instructions)
  • ๐Ÿ“Š Coverage Reports: Codecov integration (GitHub) / built-in reports
  • ๐Ÿ”„ Auto-retry: Failed requests handled automatically
  • ๐Ÿ“ฆ Artifact Storage: Build outputs saved for 7 days

Example: GitHub Actions Workflow #

name: CI/CD Pipeline

on:
  push:
    branches: [main, develop]
  pull_request:
    branches: [main, develop]

jobs:
  analyze:
    runs-on: ubuntu-latest
    steps:
      - uses: actions/checkout@v4
      - uses: subosito/flutter-action@v2
      - run: flutter analyze
      - run: dart format --set-exit-if-changed .

  test:
    needs: analyze
    runs-on: ubuntu-latest
    steps:
      - run: flutter test --coverage
      - uses: codecov/codecov-action@v4

  build-android:
    needs: test
    runs-on: ubuntu-latest
    steps:
      - run: flutter build apk --release
      - uses: actions/upload-artifact@v4

Deployment Ready #

Generated workflows include commented templates for:

  • ๐Ÿ”ฅ Firebase App Distribution - Deploy to testers instantly
  • ๐ŸŽ TestFlight - iOS beta deployment
  • โœ๏ธ Code Signing - Instructions for production builds

Setup Instructions #

After generating your project with CI/CD:

For GitHub Actions:

  1. Push your code to GitHub
  2. Workflow runs automatically on push/PR
  3. (Optional) Add CODECOV_TOKEN secret for coverage reports

For GitLab CI:

  1. Push your code to GitLab
  2. Pipeline runs automatically on push/MR
  3. For iOS builds: Configure macOS runner in .gitlab-ci.yml

For Azure Pipelines:

  1. Push your code to Azure Repos
  2. Install Flutter extension for Azure Pipelines
  3. Pipeline runs automatically on push/PR

๐Ÿค Collaboration & Team Features #

Shared Blueprint Configurations #

Share standards across your entire team! Flutter Blueprint includes a powerful configuration sharing system that lets you create, share, and enforce project standards organization-wide.

Why Use Shared Configurations? #

  • Instant consistency - All team members use the same setup
  • Faster onboarding - New developers start with proven templates
  • Enforce standards - Architecture decisions baked into project creation
  • Share best practices - Distribute knowledge through configuration
  • Reduce setup time - From hours to seconds

Share Command #

Manage shared configurations with the share command:

# List all available shared configurations
flutter_blueprint share list

# Import a configuration from file
flutter_blueprint share import ./company_standard.yaml

# Import with custom name
flutter_blueprint share import ./config.yaml --name my_config

# Export a configuration
flutter_blueprint share export company_standard ./exported.yaml

# Delete a configuration
flutter_blueprint share delete old_config

# Validate a configuration file
flutter_blueprint share validate ./config.yaml

# Use a shared configuration to create project
flutter_blueprint init my_app --from-config company_standard

Configuration Structure #

Shared configurations can define:

name: company_standard
description: Company-wide Flutter project standards
version: 1.0.0
author: Engineering Team

# State management preference
state_management: bloc # bloc, provider, riverpod

# Supported platforms
platforms:
  - android
  - ios
  - web
  - windows

# CI/CD provider
cicd_provider: github # github, gitlab, azure

# Code style preferences
code_style:
  line_length: 120
  prefer_single_quotes: true
  use_trailing_commas: true

# Architecture rules
architecture:
  enforce_clean_architecture: true
  feature_structure: domain_driven
  use_dependency_injection: true

# Required packages
required_packages:
  - dio
  - get_it
  - injectable
  - flutter_bloc
  - equatable

# Testing requirements
testing:
  require_unit_tests: true
  require_widget_tests: true
  min_coverage: 80

# Custom metadata
metadata:
  team: mobile_engineering
  updated: 2025-11-01

Example Configurations Included #

Flutter Blueprint comes with 3 production-ready configurations:

1. Company Standard (company_standard)

Enterprise-grade setup with Bloc, full platform support, and comprehensive testing:

flutter_blueprint init my_app --from-config company_standard

Features:

  • Bloc state management
  • All platforms (Android, iOS, Web, Windows, macOS, Linux)
  • GitHub Actions CI/CD
  • 120 char line length
  • Clean Architecture enforced
  • Required packages: dio, get_it, injectable, flutter_bloc

2. Startup Template (startup_template)

Lightweight MVP configuration for rapid prototyping:

flutter_blueprint init my_mvp --from-config startup_template

Features:

  • Provider state management (simpler learning curve)
  • Mobile-first (Android, iOS, Web)
  • GitHub Actions CI/CD
  • Minimal package dependencies
  • Fast iteration focus

3. Enterprise Template (enterprise_template)

Full-featured configuration for large-scale applications:

flutter_blueprint init my_enterprise_app --from-config enterprise_template

Features:

  • Riverpod state management
  • All platforms
  • Azure Pipelines (enterprise CI/CD)
  • Strict code style (80 char lines)
  • Comprehensive testing requirements (80% coverage)
  • Full dependency injection with get_it + injectable

Creating Custom Configurations #

  1. Export an existing configuration as a starting point:
flutter_blueprint share export company_standard ./my_template.yaml
  1. Edit the YAML file to match your needs:
name: my_custom_config
description: My team's Flutter standards
version: 1.0.0

state_management: riverpod
platforms:
  - android
  - ios
  - web

code_style:
  line_length: 100
  prefer_single_quotes: true

required_packages:
  - riverpod
  - freezed
  - dio
  1. Import your custom configuration:
flutter_blueprint share import ./my_template.yaml
  1. Use it to create projects:
flutter_blueprint init my_app --from-config my_custom_config

Team Workflow Example #

Setup (One-time):

# Engineering lead creates and shares configuration
flutter_blueprint share import ./company_standard.yaml

# Commit the configuration file to your team repo
git add shared_configs/company_standard.yaml
git commit -m "Add company Flutter standard"
git push

Daily Use (All developers):

# Pull latest configurations
git pull

# Import any new/updated configurations
flutter_blueprint share import ./shared_configs/company_standard.yaml

# Create new project using shared standard
flutter_blueprint init my_new_feature --from-config company_standard

# All team members get identical setup! โœจ

Validation #

All configurations are validated before use:

# Validate before importing
flutter_blueprint share validate ./config.yaml

Checks:

  • Required fields present (name, version, state_management)
  • Valid state management choice
  • Valid platform selections
  • Valid CI/CD provider
  • Proper YAML structure
  • Package names are valid

Benefits for Teams #

Without Shared Configs With Shared Configs
2-4 hours setup time 5 minutes
Inconsistent structure Identical structure
Manual standard enforcement Automatic enforcement
Knowledge in docs/wikis Executable standards
Onboarding: 1-2 days Onboarding: 30 mins

Documentation #

For complete documentation on collaboration features, see:

  • COLLABORATION_FEATURES.md - Comprehensive collaboration guide
  • PERFORMANCE_OPTIMIZATION.md - Performance monitoring and optimization

๐ŸŽฏ State Management Templates #

flutter_blueprint supports multiple state management patterns โ€” choose the one that fits your team and project best!

๐Ÿ“Š Comparison Table #

Feature Provider ๐ŸŸข Riverpod ๐ŸŸฆ Bloc ๐ŸŸฃ (Coming Soon)
Package provider: ^6.1.2 flutter_riverpod: ^2.5.1 flutter_bloc: ^8.1.0
Learning Curve Easy - ChangeNotifier pattern Medium - New concepts Steep - Event-driven architecture
Compile-Time Safety โŒ Runtime errors possible โœ… Catch errors at compile time โœ… Strong typing
Testability Good - MockNotifier needed Excellent - ProviderContainer Excellent - Easy to mock
State Class ChangeNotifier StateNotifier<State> Cubit<State> or Bloc<E, S>
UI Update notifyListeners() state = state.copyWith(...) emit(newState)
Widget Pattern Consumer<T> / Provider.of ConsumerWidget + ref.watch() BlocBuilder / BlocConsumer
Dependency Injection MultiProvider wrapper ProviderScope + global providers BlocProvider tree
Automatic Disposal Manual dispose() required โœ… Automatic โœ… Automatic
Generated Files 43 files 42 files TBD
Best For Small-medium apps, rapid prototyping Large apps, enterprise, strong teams Complex state, event-driven logic

๐ŸŸข Provider Template #

When to use: You want simplicity, familiarity, and quick onboarding for new Flutter developers.

Example State Management:

// home_provider.dart
class HomeProvider extends ChangeNotifier {
  bool _isLoading = false;
  int _counter = 0;

  void incrementCounter() {
    _counter++;
    notifyListeners(); // Manual notification
  }
}

// home_content.dart
Consumer<HomeProvider>(
  builder: (context, provider, child) {
    return Text('Counter: ${provider.counter}');
  },
)

๐ŸŸฆ Riverpod Template (NEW!) #

When to use: You want compile-time safety, better testability, and you're building a large-scale app.

Example State Management:

// home_provider.dart
class HomeState {
  final bool isLoading;
  final int counter;

  HomeState({required this.isLoading, required this.counter});

  HomeState copyWith({bool? isLoading, int? counter}) {
    return HomeState(
      isLoading: isLoading ?? this.isLoading,
      counter: counter ?? this.counter,
    );
  }
}

class HomeNotifier extends StateNotifier<HomeState> {
  HomeNotifier() : super(HomeState(isLoading: false, counter: 0));

  void incrementCounter() {
    state = state.copyWith(counter: state.counter + 1); // Immutable update
  }
}

final homeProvider = StateNotifierProvider<HomeNotifier, HomeState>((ref) {
  return HomeNotifier();
});

// home_content.dart
class HomeContent extends ConsumerWidget {
  @override
  Widget build(BuildContext context, WidgetRef ref) {
    final homeState = ref.watch(homeProvider); // Auto-rebuild on changes
    return Column(
      children: [
        Text('Counter: ${homeState.counter}'),
        ElevatedButton(
          onPressed: () => ref.read(homeProvider.notifier).incrementCounter(),
          child: Text('Increment'),
        ),
      ],
    );
  }
}

Riverpod Benefits:

  • โœ… No BuildContext needed - access providers anywhere
  • โœ… Compile-time errors - typos caught immediately
  • โœ… Immutable state - easier debugging with state history
  • โœ… Auto-disposal - no memory leaks
  • โœ… Better testing - use ProviderContainer for isolated tests
  • โœ… Family & AutoDispose modifiers for advanced use cases

๐ŸŸฃ Bloc Template (Coming Soon!) #

When to use: You need event-driven architecture, complex business logic, or team is familiar with BLoC pattern.

Stay tuned for Bloc support!


๐Ÿงฉ Generated Project Structure (43+ Files!) #

my_app/
โ”œโ”€โ”€ lib/
โ”‚   โ”œโ”€โ”€ main.dart                              # App entry point
โ”‚   โ”œโ”€โ”€ app/
โ”‚   โ”‚   โ””โ”€โ”€ app.dart                           # Root app widget with providers
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ”œโ”€โ”€ api/                               # ๐ŸŒ Network layer
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api_client.dart                #   Dio client with GET/POST/PUT/DELETE
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ api_response.dart              #   Generic response wrapper
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ interceptors/
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ auth_interceptor.dart      #   Auto-add auth tokens
โ”‚   โ”‚   โ”‚       โ”œโ”€โ”€ retry_interceptor.dart     #   Auto-retry failed requests
โ”‚   โ”‚   โ”‚       โ””โ”€โ”€ logger_interceptor.dart    #   Log all API calls
โ”‚   โ”‚   โ”œโ”€โ”€ config/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_config.dart                # ๐ŸŽ›๏ธ App configuration
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ env_loader.dart                #   Dev/Stage/Prod environments
โ”‚   โ”‚   โ”œโ”€โ”€ constants/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_constants.dart             # ๐Ÿ“‹ Timeouts, storage keys, pagination
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ api_endpoints.dart             #   Centralized API routes
โ”‚   โ”‚   โ”œโ”€โ”€ errors/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ exceptions.dart                # ๐Ÿšจ 9 custom exception types
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ failures.dart                  #   Clean architecture failures
โ”‚   โ”‚   โ”œโ”€โ”€ network/
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ network_info.dart              # ๐Ÿ“ก Connectivity monitoring
โ”‚   โ”‚   โ”œโ”€โ”€ routing/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_router.dart                # ๐Ÿงญ Route management
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ route_guard.dart               #   Auth guards
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ route_names.dart               #   Centralized route constants
โ”‚   โ”‚   โ”œโ”€โ”€ storage/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ local_storage.dart             # ๐Ÿ’พ SharedPreferences wrapper
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ secure_storage.dart            #   Secure token storage
โ”‚   โ”‚   โ”œโ”€โ”€ theme/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_theme.dart                 # ๐ŸŽจ Light/Dark themes
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ app_colors.dart                #   Color palette
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ typography.dart                #   Text styles
โ”‚   โ”‚   โ”œโ”€โ”€ utils/
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ logger.dart                    # ๐Ÿ“ Pro logger (debug/info/warn/error)
โ”‚   โ”‚   โ”‚   โ”œโ”€โ”€ validators.dart                #   Form validators (email/phone/etc)
โ”‚   โ”‚   โ”‚   โ””โ”€โ”€ extensions.dart                #   String/DateTime/Context extensions
โ”‚   โ”‚   โ””โ”€โ”€ widgets/                           # ๐Ÿงฉ Reusable UI components
โ”‚   โ”‚       โ”œโ”€โ”€ loading_indicator.dart         #   Loading spinner
โ”‚   โ”‚       โ”œโ”€โ”€ error_view.dart                #   Error display with retry
โ”‚   โ”‚       โ”œโ”€โ”€ empty_state.dart               #   Empty list placeholder
โ”‚   โ”‚       โ”œโ”€โ”€ custom_button.dart             #   Button with loading state
โ”‚   โ”‚       โ””โ”€โ”€ custom_text_field.dart         #   Styled text input
โ”‚   โ””โ”€โ”€ features/
โ”‚       โ””โ”€โ”€ home/                              # ๐Ÿ  Sample feature (clean architecture)
โ”‚           โ””โ”€โ”€ presentation/
โ”‚               โ”œโ”€โ”€ pages/
โ”‚               โ”‚   โ””โ”€โ”€ home_page.dart         #   Home screen
โ”‚               โ”œโ”€โ”€ providers/
โ”‚               โ”‚   โ””โ”€โ”€ home_provider.dart     #   State management
โ”‚               โ””โ”€โ”€ widgets/
โ”‚                   โ””โ”€โ”€ home_content.dart      #   Home UI components
โ”œโ”€โ”€ assets/
โ”‚   โ””โ”€โ”€ l10n/
โ”‚       โ”œโ”€โ”€ en.arb                             # ๐ŸŒ English translations
โ”‚       โ””โ”€โ”€ hi.arb                             #   Hindi translations
โ”œโ”€โ”€ test/
โ”‚   โ”œโ”€โ”€ widget_test.dart                       # ๐Ÿงช Sample widget test
โ”‚   โ”œโ”€โ”€ core/
โ”‚   โ”‚   โ””โ”€โ”€ utils/
โ”‚   โ”‚       โ””โ”€โ”€ validators_test.dart           #   Validator unit tests
โ”‚   โ””โ”€โ”€ helpers/
โ”‚       โ””โ”€โ”€ test_helpers.dart                  #   Test utilities
โ”œโ”€โ”€ .env.example                               # ๐Ÿ” Environment variables template
โ”œโ”€โ”€ blueprint.yaml                             # ๐Ÿ“˜ Project metadata
โ””โ”€โ”€ pubspec.yaml                               # ๐Ÿ“ฆ Dependencies

File Count by Feature Set:

  • Minimal (no optional features): 19 files
  • Full Stack (all features enabled): 43 files ๐Ÿš€

๐Ÿง  Architecture Principles #

Clean Separation of Concerns #

  • core/: Shared infrastructure (config, theme, routing, API)
  • features/: Business logic organized by feature
  • app/: Root app configuration and providers

Dependency Injection Ready #

Uses Provider for service location:

Provider<AppConfig>(create: (_) => AppConfig.load()),
Provider<ApiClient>(create: (context) => ApiClient(context.read<AppConfig>())),

Type-Safe Configuration #

class AppConfig {
  final String appTitle;
  final String environment;
  final String apiBaseUrl;
  // ...
}

๐Ÿ› ๏ธ CLI Commands #

init - Create New Project #

flutter_blueprint init <app_name> [options]

Options:

Flag Description Default
--state <choice> State management (provider/riverpod/bloc) Interactive prompt
--platforms <list> Target platforms (mobile/web/desktop or comma-separated or "all") mobile
--ci <provider> CI/CD provider (github/gitlab/azure) none
--theme Include theme scaffolding Interactive prompt
--localization Include l10n setup Interactive prompt
--env Include environment config Interactive prompt
--api Include API client Interactive prompt
--tests Include test scaffolding Interactive prompt
-h, --help Show help -
-v, --version Show version -

add feature - Incremental feature generation (killer feature) #

Add a new feature to an existing project without touching the rest of your app. The command scaffolds clean-architecture folders (data/domain/presentation), generates state-management boilerplate that matches the project's blueprint.yaml (Provider, Riverpod or BLoC), and injects a new route into app_router.dart.

Usage:

# Full feature with all layers
flutter_blueprint add feature <feature_name>

# Only presentation layer
flutter_blueprint add feature settings --presentation --no-data --no-domain

# Add feature with remote API integration
flutter_blueprint add feature products --api

Flags:

Flag Description
--data / --no-data Generate data layer (models, data sources, repository)
--domain / --no-domain Generate domain layer (entities, repository contract, use cases)
--presentation / --no-presentation Generate presentation layer (pages, widgets, state)
--api Include remote data source (Dio) in the data layer

Behavior & notes:

  • The command must be run from the root of a previously generated flutter_blueprint project (it reads blueprint.yaml).
  • It detects the project's state-management setting from blueprint.yaml and emits matching files for Provider, Riverpod, or Bloc.
  • If app_router.dart exists, the generator will add the page import, a route constant to RouteNames, and a case in the router switch to return the new page.
  • The generator is idempotent for route insertion: it will not duplicate imports or constants if they already exist.
  • For Riverpod/Bloc the generated state files follow the project's Dart version (uses sealed classes / StateNotifier / Bloc patterns as appropriate).

Examples:

# Generate a full "auth" feature using the project's state-management
flutter_blueprint add feature auth

# Generate only presentation for "settings"
flutter_blueprint add feature settings --presentation --no-data --no-domain

# Generate products feature and include remote API data source
flutter_blueprint add feature products --api

๐Ÿ“‹ blueprint.yaml #

Every generated project includes a blueprint.yaml manifest:

version: 1
app_name: my_app
platforms:
  - mobile
  - web
state_management: provider
ci_provider: github
features:
  api: true
  env: true
  localization: false
  tests: true
  theme: true

Future Use: This enables regeneration, upgrades, and feature addition.


๐ŸŽฏ Target Audience #

  • Junior developers: who don't yet know how to structure a real project
  • Indie devs: who want to spin up production-ready apps quickly
  • Small teams: who want standardization without heavy frameworks

๐Ÿšง Roadmap #

Phase 1: MVP โœ… #

  • โœ… CLI tool setup
  • โœ… Basic project generator
  • โœ… Provider template
  • โœ… Theme + routing boilerplate

Phase 2: Multi-Template Support โœ… #

  • โœ… Riverpod template
  • โœ… Bloc template
  • โœ… Localization integration
  • โœ… API client scaffolding

Phase 3: Platform Expansion โœ… (v0.4.0) #

  • โœ… Multi-platform support (mobile, web, desktop)
  • โœ… Responsive layout system
  • โœ… Adaptive navigation
  • โœ… Universal project generation
  • โœ… Platform-specific optimizations

Phase 4: Feature Generation โœ… (v0.3.0) #

  • โœ… flutter_blueprint add feature <name>
  • โœ… Clean architecture layers
  • โœ… Auto-router integration
  • โœ… State management detection

Phase 5: DevOps Integration โœ… (v0.5.0) #

  • โœ… GitHub Actions CI/CD scaffold
  • โœ… GitLab CI pipelines
  • โœ… Azure Pipelines support
  • โœ… Automated testing & builds
  • โœ… Firebase deployment templates

Phase 6: Future Enhancements ๐Ÿš€ #

  • โŒ Interactive upgrades via blueprint.yaml
  • โŒ Plugin ecosystem (auth, firebase, analytics)
  • โŒ VSCode/IntelliJ extensions
  • โŒ Blueprint dashboard (web-based config UI)
  • โŒ Project migration tools
  • โŒ Custom template support

๐Ÿค Contributing #

Contributions are welcome! Please read our Contributing Guide first.

  1. Fork the repo
  2. Create your feature branch (git checkout -b feature/amazing-feature)
  3. Commit your changes (git commit -m 'Add amazing feature')
  4. Push to the branch (git push origin feature/amazing-feature)
  5. Open a Pull Request

๐Ÿ“„ License #

This project is licensed under the MIT License - see the LICENSE file for details.


๐Ÿ’ฌ Support #


๐Ÿค– Automated Publishing & Versioning #

This package uses fully automated CI/CD with GitHub Actions. No manual version bumps or publishing needed!

How It Works #

  1. Make changes to the code
  2. Commit with conventional messages:
    • feat: โ†’ auto minor version bump (0.5.1 โ†’ 0.6.0)
    • fix: or other โ†’ auto patch bump (0.5.1 โ†’ 0.5.2)
    • feat!: or BREAKING CHANGE: โ†’ auto major bump (0.5.1 โ†’ 1.0.0)
  3. Push to main โ†’ automatic version bump, tag creation, and publish to pub.dev!

Example Workflow #

# Make changes
git add lib/src/generator/new_feature.dart

# Commit with conventional message
git commit -m "feat: add amazing new feature"

# Push to main
git push origin main

Result: Version automatically bumps to 0.6.0, tag v0.6.0 is created, and package is published to pub.dev! ๐ŸŽ‰

Skip Auto-Versioning #

Add [skip-version] to your commit message when you don't want a release:

git commit -m "docs: update README [skip-version]"

Manual Version Control #

If you prefer manual control, use the helper scripts in scripts/:

PowerShell (Windows):

.\scripts\publish.ps1 -Version 0.5.2

Bash (macOS / Linux):

./scripts/publish.sh 0.5.2

Setup Instructions #

For automated publishing to work, you need to:

  1. Enable pub.dev OIDC (one-time setup):

    • Go to pub.dev โ†’ Your package โ†’ Admin โ†’ Automated publishing
    • Enable GitHub Actions with:
      • Repository: chirag640/flutter_blueprint-Package
      • Tag pattern: v{{version}}
      • โœ… Enable push events
      • โœ… Enable workflow_dispatch
  2. Configure GitHub permissions:

    • Go to Settings โ†’ Actions โ†’ General
    • Set workflow permissions to "Read and write"
    • โœ… Allow GitHub Actions to create and approve pull requests
  3. Done! Now every push to main will trigger auto-versioning and publishing.

๐Ÿ“– Full documentation: See docs/AUTOMATED_PUBLISHING.md for complete setup guide and troubleshooting.


๐ŸŒŸ Show Your Support #

If this project helped you, please โญ the repository and share it with others!


Made with โค๏ธ for the Flutter community

5
likes
0
points
206
downloads

Publisher

unverified uploader

Weekly Downloads

CLI tool for scaffolding Flutter apps with clean architecture. Generates production-ready projects for Android, iOS, Web, and Desktop with state management, routing, and theming.

Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, flutter, interact, mustache_template, path, yaml

More

Packages that depend on flutter_blueprint