DartSdkInfo.parse constructor

DartSdkInfo.parse(
  1. String versionOutput
)

Implementation

factory DartSdkInfo.parse(String versionOutput) {
  final match = _sdkRegexp.firstMatch(versionOutput);
  if (match == null) {
    throw FormatException('Couldn\'t parse Dart SDK version: $versionOutput');
  }
  final version = Version.parse(match[1]!);
  final dateString = match[2];
  final platform = match[3];

  return DartSdkInfo._(version, dateString, platform);
}