isFlutterInstalledSync static method

void isFlutterInstalledSync()

Verifies that the Flutter CLI is installed and accessible in PATH.

Runs flutter --version synchronously and throws when the command fails.

Throws:

  • Exception when the flutter command cannot be executed.

Implementation

static void isFlutterInstalledSync() {
  try {
    print('🔍 Checking if Flutter is installed...');
    Process.runSync('flutter', ['--version']);
    print('✅ Flutter is installed');
  } catch (_) {
    throw Exception(
      'Flutter is not installed or not in PATH. Please install Flutter to use this CLI.',
    );
  }
}