run method

  1. @override
void run()
override

Runs this command.

The return value is wrapped in a Future if necessary and returned by CommandRunner.runCommand.

Implementation

@override
void run() {
  final time = Stopwatch();
  time.start();
  switch (argResults!['type'].toString().toLowerCase()) {
    case 'provider':
      generateProvider(argResults!);
      break;
    case 'getx':
      generateGetX(argResults!);
      break;
    case 'cubit':
      generateCubit(argResults!);
      break;
    case 'bloc':
      generateBloc(argResults!);
      break;
    default:
      LogService.error('Invalid Arguments');
      break;
  }
  time.stop();
  LogService.info('Time Taken: ${time.elapsed.inMilliseconds} milliseconds');
  LogService.success('Feature ${argResults!['name']} created successfully');
}