CockpitLocatorResolution.fromJson constructor

CockpitLocatorResolution.fromJson(
  1. Map<String, Object?> json
)

Decodes a CockpitLocatorResolution from a JSON object.

Implementation

factory CockpitLocatorResolution.fromJson(Map<String, Object?> json) {
  final matchedSignalsJson = json['matchedSignals'] as Map<Object?, Object?>?;
  return CockpitLocatorResolution(
    matchedKind: CockpitLocatorKind.fromJson(json['matchedKind']),
    matchedValue: json['matchedValue']! as String,
    matchedSignals: matchedSignalsJson == null
        ? const <String, String>{}
        : Map<String, String>.from(
            matchedSignalsJson.map(
              (key, value) => MapEntry('$key', '$value'),
            ),
          ),
  );
}