toMap method

Map<String, dynamic> toMap()

Implementation

Map<String, dynamic> toMap() {
  final Map<String, dynamic> json = <String, dynamic>{};

  void addIfPresent(String fieldName, dynamic value) {
    if (value != null) {
      json[fieldName] = value;
    }
  }

  addIfPresent('enabled', enabled);
  addIfPresent('circleFillColor', circleFillColor?.value);
  addIfPresent('circleStrokeColor', circleStrokeColor?.value);
  addIfPresent('circleStrokeWidth', circleStrokeWidth);
  addIfPresent('icon', icon?.toMap());
  return json;
}