BMFGradient.fromMap constructor Null safety
- Map map
map => BMFGradient
Implementation
BMFGradient.fromMap(Map map) {
if (map['colors'] != null) {
List<Color> tmpColors = [];
map['colors'].forEach((v) {
tmpColors.add(ColorUtil.hexToColor(v as String));
});
colors = tmpColors;
}
if (map['startPoints'] != null) {
List<double> tmpStartPoints = [];
map['startPoints'].forEach((v) {
tmpStartPoints.add(v as double);
});
startPoints = tmpStartPoints;
}
}