fromJson static method
Returns a new Position3gppLacCi instance and imports its values from
value if it's a Map, null otherwise.
Implementation
// ignore: prefer_constructors_over_static_methods
static Position3gppLacCi? fromJson(dynamic value) {
if (value is Map) {
final json = value.cast<String, dynamic>();
// Ensure that the map contains the required keys.
// Note 1: the values aren't checked for validity beyond being non-null.
// Note 2: this code is stripped in release mode!
assert(() {
requiredKeys.forEach((key) {
assert(json.containsKey(key),
'Required key "Position3gppLacCi[$key]" is missing from JSON.');
assert(json[key] != null,
'Required key "Position3gppLacCi[$key]" has a null value in JSON.');
});
return true;
}());
return Position3gppLacCi(
latitude: json[r'latitude'] == null
? null
: num.parse(json[r'latitude'].toString()),
longitude: json[r'longitude'] == null
? null
: num.parse(json[r'longitude'].toString()),
precision: json[r'precision'] == null
? null
: num.parse(json[r'precision'].toString()),
mnc: json[r'mnc'] == null ? null : num.parse(json[r'mnc'].toString()),
mcc: json[r'mcc'] == null ? null : num.parse(json[r'mcc'].toString()),
lac: json[r'lac'] == null ? null : num.parse(json[r'lac'].toString()),
cellId: json[r'cellId'] == null
? null
: num.parse(json[r'cellId'].toString()),
status: Position3gppLacCiStatus.fromJson(json[r'status']),
message: mapValueOfType<String>(json, r'message'),
);
}
return null;
}