BMFPoiBoundSearchOption.fromMap constructor Null safety

BMFPoiBoundSearchOption.fromMap(
  1. Map map
)

map => BMFPoiBoundSearchOption

Implementation

BMFPoiBoundSearchOption.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;
  }
  leftBottom = map['leftBottom'] == null
      ? null
      : BMFCoordinate.fromMap(map['leftBottom']);
  rightTop =
      map['rightTop'] == null ? null : BMFCoordinate.fromMap(map['rightTop']);
  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?;
}