fromJson static method
Returns a new Marker instance and imports its values from
json
if it's non-null, null if json
is null.
Implementation
static Marker? fromJson(Map<String, dynamic>? json) {
if (json == null) {
return null;
}
DateTime? createdAt =
json[r'createdAt'] == null ? null : DateTime.parse(json[r'createdAt']);
if (createdAt != null && createdAt.isUtc == false) {
createdAt = DateTime.parse('${json[r'createdAt']}Z');
}
return Marker(
links: MarkerLinks.fromJson(json[r'_links']),
createdAt: createdAt,
id: json[r'id'],
point: Point.fromJson(json[r'point'])!,
type: json[r'type'],
);
}