moarch 2.5.0 copy "moarch: ^2.5.0" to clipboard
moarch: ^2.5.0 copied to clipboard

Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.

example/example.dart

import 'dart:io';

import 'package:mason_logger/mason_logger.dart';
import 'package:moarch/moarch.dart';

const _projectInitCommand = ['init', '--all'];
const _featureCreateCommand = ['create', 'feature', 'auth', '--all'];

void main(List<String> args) async {
  final logger = Logger();

  logger.info('moarch example: supported scaffold options');
  logger.info('');
  logger.info('1) Project initialization (full scaffold)');
  logger.info('   dart run example/example.dart --show');
  logger.info('   moarch init --all');
  logger.info('');
  logger.info('   Optional interactive init selections include:');
  logger.info(
      '     - Backend / networking: Dio, Firebase Firestore, Firebase Auth');
  logger.info('     - Router (GoRouter)');
  logger.info('     - Workflows (security, tests, build)');
  logger.info('     - Helper folder (dialog and bottom modal)');
  logger.info('     - Media Service (image/file picker + PermissionService)');
  logger.info('     - Launch URL service');
  logger.info('     - Debouncer service');
  logger.info('     - Notifications service');
  logger.info('     - Firebase push notifications (FCM)');
  logger.info(
      '     - Biometric authentication (local_auth, wired into AppButton)');
  logger.info('     - Localization (l10n or easy_localization)');
  logger.info('     - Test folder and deployment checklists');
  logger.info('');
  logger
      .info('   UI kit (lib/shared/widgets/) — init generates the common set:');
  logger.info(
      '     - Inputs: AppInput (+ password eye), AppInputStyle, InputTitle');
  logger.info('     - AppButton (loading + disabled), AppLeadingIcon');
  logger.info('     - State screens: ErrorView, EmptyView, AppLoadingData');
  logger.info(
      '     - Overlays: AppToast, AppConfirmDialog, dialog/bottom-sheet helpers');
  logger
      .info('     - Theme tokens & TextTheme (config/theme + core/constants)');
  logger.info('     - docs/UI_KIT.md catalogues the whole kit');
  logger.info('');
  logger.info('   Add any other widget on demand:');
  logger.info(
      '     moarch create widget <name>   (e.g. switch, otp, list-tile, card, slider,');
  logger.info(
      '                                    icon-button, app-bar, banner, progress-bar,');
  logger.info(
      '                                    search-field, stepper, section-header,');
  logger.info(
      '                                    expansion-tile, step-indicator)');
  logger.info(
      '     moarch create widget all      -> whole kit + DesignSystemView preview');
  logger.info(
      '     moarch create widget --list   -> list every available widget');
  logger.info('');
  logger.info('2) Feature generation (Clean Architecture layers)');
  logger.info('   moarch create feature auth --all');
  logger.info(
      '   (Tests are generated by the mogen_unit_tests package on pub.dev)');
  logger.info('');
  logger.info('   Optional feature layers include:');
  logger.info('     - Remote Datasource');
  logger.info('     - Local/Cache Datasource');
  logger.info('     - Repository interface + implementation');
  logger.info('     - Use Cases');
  logger.info('     - State + Notifier');
  logger.info('     - View');
  logger.info('');
  logger.info(
      '3) Existing feature support: generate tests only when feature already exists');
  logger.info('   moarch create feature auth');
  logger.info('');
  logger.info('4) Preview an init without writing any files');
  logger.info('   moarch init --dry-run');
  logger.info('');
  logger.info('5) Check an existing scaffolded project for common issues');
  logger.info('   moarch doctor');
  logger.info('');
  logger.info(
      'Run with --execute to actually scaffold the sample commands into the current directory.');
  logger.info('');

  if (args.contains('--execute')) {
    final runner = MoarchRunner();
    final workingDir = Directory.current.path;

    final progress = logger.progress('Executing sample scaffold commands');
    progress.update('Working directory: $workingDir');
    await runner.run(_projectInitCommand);
    await runner.run(_featureCreateCommand);
    progress.complete('Sample generation commands completed.');
  }
}
2
likes
0
points
6.1k
downloads

Publisher

unverified uploader

Weekly Downloads

Flutter CLI — scaffold Clean Architecture projects with Riverpod, FVM and your own conventions.

Homepage
Repository (GitHub)
View/report issues

License

unknown (license)

Dependencies

args, mason_logger, path, yaml, yaml_edit

More

Packages that depend on moarch