required<V> method
- @nonVirtual
Maps a required named parameter of a constructor.
Parameter value
is the mapped value.
Parameter name
is the name of the named parameter.
Optional parameter kind
is the kind of the value. If omitted, the kind
is inferred from V
and value
using Kind.find.
Optional parameter defaultConstant
is the default value.
Optional parameter tags
is a list Trait instances such as
ProtobufFieldTag
.
Example
See ImmutableKind.
Implementation
@nonVirtual
V required<V>(
V value,
String name, {
Kind<V>? kind,
Kind? superKind,
String? jsonName,
List<Trait> tags = const [],
}) {
if (kind != null && superKind != null) {
throw ArgumentError.value(
superKind,
'superKind',
'Must be null if kind is not null',
);
}
return handle<V>(
parameterType: ParameterType.requiredNamed,
value: value,
name: name,
kind: kind ?? superKind,
jsonName: jsonName,
tags: tags,
);
}