FMRawData.fromJSON constructor
FMRawData.fromJSON(
- Map<String, dynamic> data
)
Implementation
factory FMRawData.fromJSON(Map<String, dynamic> data) {
return FMRawData(
type: '${data['type'] ?? ''}',
name: '${data['name'] ?? ''}',
osmId: '${data['osm_id'] ?? ''}',
lat: double.parse('${data['lat']}'),
lng: double.parse('${data['lon']}'),
license: '${data['licence'] ?? ''}',
osmType: '${data['osm_type'] ?? ''}',
placeId: '${data['place_id'] ?? ''}',
category: '${data['category'] ?? ''}',
placeRank: '${data['place_rank'] ?? ''}',
importance: '${data['importance'] ?? ''}',
addressType: '${data['address_type'] ?? ''}',
displayName: '${data['display_name'] ?? ''}',
address:
data['address'] == null ? null : FMAddress.fromJSON(data['address']),
geoJson: data['geojson'] == null
? null
: FMGeoJsonModel.fromJSON(data['geojson']),
boundingBox:
(data['boundingbox'] as List<dynamic>?)?.map((e) => '$e').toList() ??
[],
);
}