bclean 0.1.5
bclean: ^0.1.5 copied to clipboard
A powerful CLI tool for Flutter to generate Clean Architecture with BLoC or Cubit state management and dartz error handling, inspired by get_cli.
0.1.5 #
- Resolved static analysis lint (
unnecessary_brace_in_string_interps) and formatted all source files withdart formatfor full 160/160 pub.dev score.
0.1.4 #
- Real Internet Connectivity Check (
internet_connection_checker_plus):bclean initnow addsinternet_connection_checker_plustopubspec.yaml, registersInternetConnectionininjection_container.dart, and implementsNetworkInfoImpl.isConnectedusingconnectionChecker.hasInternetAccess.
- Auto-Dispatch Initial Load Event in Pages:
- Generated Pages now automatically trigger
..add(const Load<Feature>Event(...))(for BLoC) or..load<Feature>(...)(for Cubit) insideBlocProvider, so opening a page immediately loads data without staying stuck on the initial state.
- Generated Pages now automatically trigger
- Readable Entity Output (
stringify => true):- Added
@override bool get stringify => true;to all generatedEquatableEntities and Models soitem.toString()displays all field values cleanly in UI lists.
- Added
- Full UseCase Auto-Wiring Across All Layers:
bclean create usecase:<name> on <feature>now also injects the method signature and@overrideimplementation into<feature>_remote_data_source.dartin addition toRepository,RepositoryImpl, andinjection_container.dart.
- Standalone BLoC/Cubit Auto-DI Registration:
bclean create bloc:<name> on <feature>andbclean create cubit:<name> on <feature>now automatically register the new BLoC/Cubit inlib/injection_container.dart.
- Smart Singular/Plural JSON Model Sync:
bclean generate modelautomatically maps singular/plural JSON filenames (e.g.,post.jsonon featureposts) to the feature's primary Entity and Model when--nameis not specified.
0.1.3 #
- Single Item & JSON List Support (
--list/-l):- Added
--list(-l) flag tobclean create feature:<name>,bclean create usecase:<name>,bclean create bloc:<name>,bclean create cubit:<name>, andbclean create page:<name>to generateList<Entity>return types,NoParamsUseCases, andListView.builderUI pages. - Added
static List<Model> fromJsonList(List<dynamic> jsonList)to all generated Models alongsidefactory Model.fromJson(Map<String, dynamic> json). - Auto JSON List Detection in
bclean g model: When generating a model from a JSON file whose root is a JSON Array[{...}]and whose name matches the target feature (e.g.,bclean g model on posts with assets/posts.json),bcleanautomatically upgrades the feature's DataSources, Repository, UseCase, BLoC/Cubit, and Page toList<Entity>mode. - Updated DataSource templates to use
Model.fromJson(const {})andModel.fromJsonList(const [])placeholders so custom fields generated from JSON never break DataSource compilation.
- Added
0.1.2 #
- Default Starter Route:
AppRouter.routesnow includes a default'/'starter route out-of-the-box soMaterialAppnever throws an empty-routes assertion error if run before creating a feature. - Auto-Discovery & Auto-Init:
- Running
bclean create feature:<name>beforebclean initnow automatically initializescore/,injection_container.dart,app_router.dart, andmain.dart. - Running
bclean initin a project that already has features insidelib/features/automatically discovers and registers all existing features ininjection_container.dartandapp_router.dart.
- Running
0.1.1 #
- Auto
main.dartSetup:bclean initnow automatically generates/updateslib/main.dartwithWidgetsFlutterBinding.ensureInitialized(),await di.initDependencies(), andAppRouter.routespre-configured soGetItis always initialized beforerunApp. - Smart Initial Route:
AppRouter.initialautomatically updates to the first created feature/page route so the app runs out-of-the-box without manual route edits. - Enhanced Documentation: Expanded
README.mdwith a step-by-step Quick Start guide, command reference table, architecture tree, and JSON-to-Model examples.
0.1.0 #
- Initial release of
bcleanCLI. - Added
bclean initcommand to scaffold Clean Architecturecore/layer (failures.dart,exceptions.dart,usecase.dartwithdartz,network_info.dart),app_router.dart,injection_container.dart(get_it), and auto-add required dependencies inpubspec.yaml. - Added
bclean create feature:<name>command to generate full Domain, Data, and Presentation layers (BLoCorCubitvia--cubit) with automatic DI and Router registration. - Added sub-component generators:
bclean create usecase:<name> on <feature>,bclean create bloc:<name> on <feature>,bclean create cubit:<name> on <feature>, andbclean create page:<name> on <feature>. - Added
bclean generate model on <feature> with <path/to/file.json>to automatically generate Domain Entities (Equatable) and Data Models (fromJson,toJson,copyWith) from JSON files.