toJson method

Map<String, Object?> toJson()

Converts paint settings to a JSON-friendly map.

Implementation

Map<String, Object?> toJson() => {
      if (fill != null) 'fill': fill,
      if (pattern != null) 'pattern': pattern!.toJson(),
      if (stroke != null) 'stroke': stroke,
      'lineWidth': lineWidth,
      'font': font,
    };