version static method
Get the current installed Flutter version on the system
Implementation
static Future<String> version() async {
try {
final version = await Process.run('flutter', ['--version']);
if (version.exitCode != 0) {
return '';
}
final versionString = version.stdout.toString().split('\n')[0].trim();
final match = RegExp(r'Flutter (.*?) • https').firstMatch(versionString);
return match?.group(1) ?? '';
} on Exception catch (_) {
return '';
}
}