BMFTraceOverlay.fromMap constructor

BMFTraceOverlay.fromMap(
  1. Map map
)

map => BMFTraceOverlay

Implementation

BMFTraceOverlay.fromMap(Map map)
    : assert(map['coordinates'] != null),
      assert(map['traceOverlayAnimateOption'] != null),
      super.fromMap(map) {
  if (map['coordinates'] != null) {
    coordinates = <BMFCoordinate>[];
    map['coordinates'].forEach((v) {
      coordinates.add(BMFCoordinate.fromMap(v as Map));
    });
  }
  traceOverlayAnimateOption =
      BMFTraceOverlayAnimateOption.formMap(map['traceOverlayAnimateOption']);
  width = map['width'] as int;
  strokeColor = ColorUtil.hexToColor(map['strokeColor']);
  fillColor = ColorUtil.hexToColor(map['fillColor']);
  if (map['isGradientColor'] != null) {
    isGradientColor = map['isGradientColor'] as bool;
  }
  if (map['isTrackBloom'] != null) {
    isTrackBloom = map['isTrackBloom'] as bool;
  }
  if (map['bloomSpeed'] != null) {
    bloomSpeed = map['bloomSpeed'] as double;
  }
  if (map['isThined'] != null) {
    isThined = map['isThined'] as bool;
  }
  if (map['isCornerSmooth'] != null) {
    isCornerSmooth = map['isCornerSmooth'] as bool;
  }
  if (map['strokeColors'] != null) {
    strokeColors = <Color>[];
    map['strokeColors'].forEach((v) {
      strokeColors!.add(ColorUtil.hexToColor(v as String));
    });
  }
}