fabrik 0.1.8 copy "fabrik: ^0.1.8" to clipboard
fabrik: ^0.1.8 copied to clipboard

A CLI to generate scalable, testable, clean Flutter feature scaffolding using DDD layered architecture.

🧱 Fabrik CLI #

A powerful CLI tool to generate scalable, testable, and clean Flutter feature scaffolding using DDD layered architecture.

Built with developer experience in mind β€” generate complete feature folders in seconds.


✨ Features #

  • βœ… Clean architecture structure (Model β†’ Entity β†’ DataSource β†’ Repository β†’ UseCase β†’ BLoC)
  • βœ… Barrel files auto-generated
  • βœ… Supports --output-dir or -o to customize output
  • πŸ› οΈ Optional flags like --with-bloc, --minimal coming soon

πŸš€ Installation #

dart pub global activate fabrik

βš™οΈ Set Up PATH (if needed) #

After activating the CLI, make sure Dart’s global bin directory is in your system PATH.

macOS/Linux

# Add this to your shell config file (~/.zshrc, ~/.bashrc, etc.)
export PATH="$PATH":"$HOME/.pub-cache/bin"

Windows

Locale the dart global bin path and add it to system PATH

C:\Users\<YourUsername>\AppData\Local\Pub\Cache\bin

🧰 Usage #

Generate a feature #

fabrik generate feature auth

This will create:

./auth/
  |- models/
  |- entities/
  |- usecases/
  |- blocs/
  |- repository.dart
  |- data_source.dart
  |- auth.dart (barrel)

Generate into a specific folder #

fabrik generate feature auth -o app_auth

➑️ Outputs to ./app_auth/


πŸ“¦ Output Example #

Inside your feature folder:

lib/features/auth/
  |- models/
     |- user_model.dart
     |- models.dart
  |- entities/
     |- user.dart
     |- entities.dart
  |- usecases/
     |- login_usecase.dart
     |- usecases.dart
  |- blocs/
     |- auth_bloc.dart
     |- auth_event.dart
     |- auth_state.dart
  |- repository.dart
  |- data_source.dart
  |- auth.dart

All classes are stubbed with clean and minimal code β€” ready to be implemented.


Fabrik scaffolds rely on some essential packages for clean architecture, error handling, and code generation.

To get started, add the following to your pubspec.yaml:

dependencies:
  # Core utility package containing Failure & Status classes
  flutter_core:
    git:
      url: https://github.com/abhakhand/flutter_core.git
      ref: main

  # Functional programming support (Either, Option, etc.)
  dartz:

  # State management with BLoC
  bloc:
  flutter_bloc:
  equatable:

  # Code generation support
  json_annotation:
  freezed_annotation:

  # Dependency injection
  get_it: ^7.6.4
  injectable: ^2.3.2

dev_dependencies:
  build_runner:
  freezed:
  injectable_generator:
  json_serializable:
  very_good_analysis:

βš™οΈ Don’t forget to run #

flutter pub get
dart run build_runner build --delete-conflicting-outputs

  • mason β€” powering this scaffolding magic.
  • flutter_core β€” recommended base package for Failure, Status, and architecture utilities.

πŸ“£ Coming Soon #

  • ❌ --minimal flag for model-only scaffolds
  • ❌ fabrik init to generate ApiClient, Config, and other architecture utils
  • ❌ VSCode Extension for Fabrik
  • ❌ Web UI at fabriktool.com

Maintainers #

Inspired by real-world Flutter app architecture challenges. Open source. Open to contributions. Built for the Flutter community.

5
likes
0
points
12
downloads

Publisher

verified publisherfabriktool.com

Weekly Downloads

A CLI to generate scalable, testable, clean Flutter feature scaffolding using DDD layered architecture.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, mason, mason_logger

More

Packages that depend on fabrik