Wire.fromJson constructor
Wire.fromJson(
- Object? j
Implementation
factory Wire.fromJson(Object? j) {
final json = j as Map<String, Object?>;
return Wire(
adminEnabled: switch (json['adminEnabled']) {
null => null,
Object $1 => decodeBool($1),
},
endpoints: switch (json['endpoints']) {
null => [],
List<Object?> $1 => [for (final i in $1) WireEndpoint.fromJson(i)],
_ => throw const FormatException('"endpoints" is not a list'),
},
label: switch (json['label']) {
null => null,
Object $1 => decodeString($1),
},
wireProperties: switch (json['wireProperties']) {
null => null,
Object $1 => WireProperties.fromJson($1),
},
);
}