APP_DART_TPL top-level constant

String const APP_DART_TPL

Template for the application bootstrap file: lib/{{projectName}}.dart. Contains the function that configures and runs the CardinalApp.

Variables:

  • {{projectName}}: Project name (used for imports and app name).
  • {{functionName}}: The name of the bootstrap function (e.g., runApp).

Implementation

const String APP_DART_TPL = r'''
import 'package:cardinal/cardinal.dart';
import 'package:{{projectName}}/commands/hello_command.dart';

Future<void> {{functionName}}(List<String> args) async {
  final app = CardinalApp(
    name: '{{projectName}}',
    description: 'A command line application built with the Cardinal framework.',
    commands: [
      HelloCommand(),
    ],
  );

  await app.run(args);
}
''';