flg 1.0.0
flg: ^1.0.0 copied to clipboard
A CLI tool for generating Flutter projects with Clean Architecture, feature-first organization, and modern state management (Riverpod, Bloc, Provider).
Changelog #
All notable changes to this project will be documented in this file.
The format is based on Keep a Changelog, and this project adheres to Semantic Versioning.
1.0.0 - 2026-01-28 #
Added #
-
initcommand - Create new Flutter projects with Clean Architecture- Interactive configuration prompts
- Support for Riverpod (with
@riverpodannotation), Bloc, and Provider - Support for GoRouter and AutoRoute
- Optional Freezed integration with
sealed classsyntax - Optional Dio HTTP client
- Multi-platform support (Android, iOS, Web, macOS, Windows, Linux)
- Localization (l10n) support
- Automatic
build_runnerexecution after project creation
-
setupcommand - Configure flg in existing Flutter projects- Detects existing
pubspec.yamland extracts project name - Adds required dependencies automatically
- Creates Clean Architecture directory structure
- Generates core files (exceptions, failures, usecase base, router)
- Optional initial feature generation
- Runs
pub getandbuild_runnerautomatically
- Detects existing
-
generatecommand with subcommands:feature(alias:f) - Generate complete feature modulesscreen(alias:s) - Generate screen widgetswidget(alias:w) - Generate widgets (stateless, stateful, card, list_tile, form)provider(alias:p) - Generate providers/notifiers/blocsusecase(alias:u) - Generate use cases (single or CRUD)repository(alias:r) - Generate repositories with data sources
-
Core templates:
- Exceptions and Failures classes
- Base UseCase classes with
Either<Failure, T>pattern - App Router configuration (GoRouter or AutoRoute)
- Main.dart with state management setup
-
Feature templates:
- Entity classes with Equatable
- Repository interfaces
- Model classes with Freezed
sealed classsyntax - Repository implementations
- Remote data sources (Dio or http)
- Riverpod notifiers using
@riverpodannotation with code generation - Bloc classes with events and states
- Provider classes with ChangeNotifier
- Screen widgets with state management integration
- Widget templates (card, list tile, form)
-
Configuration:
flg.jsonfile for project settings persistence- Automatic configuration detection in existing projects
-
Developer experience:
--dry-runflag to preview changes without creating files--verboseflag for detailed output--no-colorflag for CI/CD environments- Colored console output with progress indicators
Technical Details #
- Written in pure Dart with no Flutter dependency
- Uses absolute package imports (
package:project_name/...) - Modern Riverpod with
riverpod_annotationand code generation - Modern Freezed with
sealed classsyntax - Comprehensive test suite (81 tests)