BMFOpenRouteOption.fromMap constructor Null safety
- Map map
map => BMFOpenRouteOption
Implementation
BMFOpenRouteOption.fromMap(Map map)
: assert(
map != null, //ignore: unnecessary_null_comparison
'Construct a BMFOpenRouteOption,The parameter map cannot be null !'),
assert(map.containsKey('startCoord')),
assert(map.containsKey('endCoord')),
assert(map.containsKey('routeTyp')) {
startCoord = map['startCoord'] != null
? BMFCoordinate.fromMap(map['startCoord'])
: null;
endCoord =
map['endCoord'] != null ? BMFCoordinate.fromMap(map['endCoord']) : null;
startName = map['startName'];
endName = map['endName'];
routeType = map['routeType'] != null
? BMFOpenRouteType.values[map['routeType'] as int]
: null;
transitPolicy = map['transitPolicy'] != null
? BMFOpenTransitPolicy.values[(map['transitPolicy'] as int) - 3]
: null;
appScheme = map['appScheme'];
isSupportWeb = map['isSupportWeb'] as bool?;
}