BaseFlutterCommand class base

A command class that provides common Flutter CLI operations.

This class extends CliCommand and provides methods for:

  • Creating new Flutter projects (apps, packages, plugins)
  • Managing project files and configurations
  • Running Flutter commands like pub get

Example usage:

class MyFlutterCommand extends BaseFlutterCommand {
  @override
  Future<void> run(HookContext context) async {
    await createFlutterProject(
      context: context,
      name: 'my_app',
      description: 'My Flutter application',
      outputPath: 'path/to/output',
    );
  }
}
Inheritance

Constructors

BaseFlutterCommand.new()

Properties

hashCode int
The hash code for this object.
no setterinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited

Methods

createFlutterProject({required HookContext context, required String name, required String description, required String outputPath, String template = 'app', List<String> platforms = const ['ios', 'android', 'web'], String? orgName}) Future<void>
Creates a new Flutter project.
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
pubGet({required HookContext context, required String projectPath}) Future<void>
Run Flutter pub get in a directory
removeAnalysisOptions({required HookContext context, required String projectPath}) Future<void>
Remove the generated analysis_options.yaml file from a Flutter project
run(HookContext context) Future<void>
Run the command with the given HookContext
inherited
toString() String
A string representation of this object.
inherited
trackOperation(HookContext context, {required String startMessage, required String endMessage, required Future<void> operation()}) Future<void>
Track an operation with progress indicator
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited