run method

  1. @override
Future<void> run()
override

Runs this command.

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

Implementation

@override
Future<void> run() async {
  final cliHanldler = CliHandler();
  cliHanldler.clearScreen();
  cliHanldler.printBoltCyanText('Updated Your App Version code');
  final currentVersion = PubspecHandler.getVersion();
  PubspecHandler.updatePubspecValue('1.0.0+${currentVersion + 1}');

  final ProcessResult buildAppBundle = await Process.run(
    'flutter',
    ['build', 'appbundle'],
  );
  if (buildAppBundle.exitCode != 0) {
    print(
        'Error building appbundle!');
    print(buildAppBundle.stderr);
    return;
  }
}