toJson method
Implementation
@override
Map<String, dynamic> toJson() {
final json = <String, dynamic>{};
void addIfPresent(String fieldName, dynamic value) {
if (value != null) {
json[fieldName] = value;
}
}
addIfPresent('icon-opacity', iconOpacity);
addIfPresent('icon-color', iconColor);
addIfPresent('icon-halo-color', iconHaloColor);
addIfPresent('icon-halo-width', iconHaloWidth);
addIfPresent('icon-halo-blur', iconHaloBlur);
addIfPresent('icon-translate', iconTranslate);
addIfPresent('icon-translate-anchor', iconTranslateAnchor);
addIfPresent('text-opacity', textOpacity);
addIfPresent('text-color', textColor);
addIfPresent('text-halo-color', textHaloColor);
addIfPresent('text-halo-width', textHaloWidth);
addIfPresent('text-halo-blur', textHaloBlur);
addIfPresent('text-translate', textTranslate);
addIfPresent('text-translate-anchor', textTranslateAnchor);
addIfPresent('symbol-placement', symbolPlacement);
addIfPresent('symbol-spacing', symbolSpacing);
addIfPresent('symbol-avoid-edges', symbolAvoidEdges);
addIfPresent('symbol-sort-key', symbolSortKey);
addIfPresent('symbol-z-order', symbolZOrder);
addIfPresent('icon-allow-overlap', iconAllowOverlap);
addIfPresent('icon-ignore-placement', iconIgnorePlacement);
addIfPresent('icon-optional', iconOptional);
addIfPresent('icon-rotation-alignment', iconRotationAlignment);
addIfPresent('icon-size', iconSize);
addIfPresent('icon-text-fit', iconTextFit);
addIfPresent('icon-text-fit-padding', iconTextFitPadding);
addIfPresent('icon-image', iconImage);
addIfPresent('icon-rotate', iconRotate);
addIfPresent('icon-padding', iconPadding);
addIfPresent('icon-keep-upright', iconKeepUpright);
addIfPresent('icon-offset', iconOffset);
addIfPresent('icon-anchor', iconAnchor);
addIfPresent('icon-pitch-alignment', iconPitchAlignment);
addIfPresent('text-pitch-alignment', textPitchAlignment);
addIfPresent('text-rotation-alignment', textRotationAlignment);
addIfPresent('text-field', textField);
addIfPresent('text-font', textFont);
addIfPresent('text-size', textSize);
addIfPresent('text-max-width', textMaxWidth);
addIfPresent('text-line-height', textLineHeight);
addIfPresent('text-letter-spacing', textLetterSpacing);
addIfPresent('text-justify', textJustify);
addIfPresent('text-radial-offset', textRadialOffset);
addIfPresent('text-variable-anchor', textVariableAnchor);
addIfPresent('text-anchor', textAnchor);
addIfPresent('text-max-angle', textMaxAngle);
addIfPresent('text-writing-mode', textWritingMode);
addIfPresent('text-rotate', textRotate);
addIfPresent('text-padding', textPadding);
addIfPresent('text-keep-upright', textKeepUpright);
addIfPresent('text-transform', textTransform);
addIfPresent('text-offset', textOffset);
addIfPresent('text-allow-overlap', textAllowOverlap);
addIfPresent('text-ignore-placement', textIgnorePlacement);
addIfPresent('text-optional', textOptional);
addIfPresent('visibility', visibility);
return json;
}