BMFPolygon.fromMap constructor Null safety
- Map map
map => BMFPolygon
Implementation
BMFPolygon.fromMap(Map map)
: assert(map['coordinates'] != null),
super.fromMap(map) {
if (map['coordinates'] != null) {
coordinates = [];
map['coordinates'].forEach((v) {
coordinates.add(BMFCoordinate.fromMap(v as Map));
});
}
width = map['width'];
strokeColor = ColorUtil.hexToColor(map['strokeColor']);
fillColor = ColorUtil.hexToColor(map['fillColor']);
lineDashType = BMFLineDashType.values[map['lineDashType'] as int];
if (map['hollowShapes'] != null) {
hollowShapes = [];
for (var item in hollowShapes!) {
BMFHollowShape hollowShape = BMFHollowShape.fromMap(item as Map);
hollowShapes!.add(hollowShape);
}
}
}