BMFPoiNearbySearchOption.fromMap constructor Null safety

BMFPoiNearbySearchOption.fromMap(
  1. Map map
)

map => BMFPoiNearbySearchOption

Implementation

BMFPoiNearbySearchOption.fromMap(Map map)
    : assert(
          map != null, // ignore: unnecessary_null_comparison
          'Construct a BMFPoiNearbySearchOption,The parameter map cannot be null !') {
  if (map['keywords'] != null) {
    List<String> tmpKeywords = [];
    map['keywords'].forEach((v) {
      tmpKeywords.add(v as String);
    });
    keywords = tmpKeywords;
  }

  if (map['tags'] != null) {
    List<String> tmpTags = [];
    map['tags'].forEach((v) {
      tmpTags.add(v as String);
    });
    tags = tmpTags;
  }

  location =
      map['location'] == null ? null : BMFCoordinate.fromMap(map['location']);
  radius = map['radius'];
  isRadiusLimit = map['isRadiusLimit'];
  scope = BMFPoiSearchScopeType.values[map['scope'] as int];
  filter = map['filter'] == null
      ? null
      : BMFPoiSearchFilter.fromMap(map['filter']);
  pageIndex = map['pageIndex'];
  pageSize = map['pageSize'];
  extensionsAdcode = map['extensionsAdcode'] as bool?;
}