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() async {
  print('🔍 Checking for updates...\n');

  try {
    final message = await FlutterReleaseXUpdateCheckService.getUpdateMessage(
      forceCheck: true,
    );

    if (message != null) {
      print(message);
    } else {
      print(
          '✅ You are using the latest version of FRX (${FlutterReleaseXKstrings.version})');
    }
  } catch (e) {
    print('⚠️  Could not check for updates. Please try again later.');
    print('   Error: $e');
  }
}