Metadata.parse constructor Null safety
Creates a new Metadata, but with fields parsed from caller-friendly values where applicable.
Throws a FormatException if any field is invalid.
Implementation
Metadata.parse(
{String? testOn,
Timeout? timeout,
dynamic skip,
bool? verboseTrace,
bool? chainStackTraces,
int? retry,
Map<String, dynamic>? onPlatform,
tags,
this.languageVersionComment})
: testOn = testOn == null
? PlatformSelector.all
: PlatformSelector.parse(testOn),
timeout = timeout ?? const Timeout.factor(1),
_skip = skip == null ? null : skip != false,
_verboseTrace = verboseTrace,
_chainStackTraces = chainStackTraces,
_retry = retry,
skipReason = skip is String ? skip : null,
onPlatform = _parseOnPlatform(onPlatform),
tags = _parseTags(tags),
forTag = const {} {
if (skip != null && skip is! String && skip is! bool) {
throw ArgumentError('"skip" must be a String or a bool, was "$skip".');
}
if (retry != null) RangeError.checkNotNegative(retry, 'retry');
_validateTags();
}