version static method

String version()

Get the current installed Dart version on the system

Implementation

static String version() {
  final version = Platform.version;
  final match = RegExp(r'^([\w\.-]+ \(\w+\))').firstMatch(version);
  return match?.group(1) ?? version.split(' ')[0];
}