clean_arch 1.0.2 copy "clean_arch: ^1.0.2" to clipboard
clean_arch: ^1.0.2 copied to clipboard

A command-line tool that scaffolds Flutter projects following Clean Architecture — generates the full core layer and feature modules with boilerplate files in one command.

example/main.dart

// This example shows how to use clean_arch programmatically.
//
// In normal CLI usage:
//   clean_arch init
//   clean_arch normal init
//   clean_arch feature auth
//   clean_arch normal feature auth

import 'package:clean_arch/generators/architecture_generator.dart';
import 'package:clean_arch/generators/feature_generator.dart';

void main(List<String> args) {
  final useNormalArchitecture = args.contains('--normal');

  if (useNormalArchitecture) {
    // Creates core/widgets, core/utils, core/controllers, core/helper,
    // core/services, core/theme and starter auth/home feature folders.
    generateStandardArchitecture();

    // Creates features/profile/{model,services,provider,screens}/...
    generateFeature('profile', architectureType: 'normal');
  } else {
    // Creates clean architecture core structure.
    generateArchitecture();

    // Creates clean architecture feature layers.
    generateFeature('auth', architectureType: 'clean');
  }
}
1
likes
160
points
286
downloads

Documentation

API reference

Publisher

verified publisherabhishek-sharma.com.np

Weekly Downloads

A command-line tool that scaffolds Flutter projects following Clean Architecture — generates the full core layer and feature modules with boilerplate files in one command.

Repository (GitHub)
View/report issues

License

MIT (license)

More

Packages that depend on clean_arch