toJson method
Implementation
Map<String, dynamic> toJson() {
return <String, dynamic>{
'blendMode': blendMode.index,
'color': color.value,
if (colorFilter != null) 'colorFilter': colorFilter?.toString(),
'filterQuality': filterQuality.index,
if (imageFilter != null) 'imageFilter': imageFilter?.toString(),
'invertColors': invertColors,
'isAntiAlias': isAntiAlias,
if (maskFilter != null) 'maskFilter': maskFilter?.toString(),
// if (shader != null) 'shader': shader?.toString(), // 无法解析
'strokeCap': strokeCap.index,
'strokeJoin': strokeJoin.index,
'strokeWidth': strokeWidth,
'style': style.index,
};
}