toJson method
Abstract function that concrete classes must implement. This must encode the internal data model to a JSON compatible representation.
While not required, it is suggested to call removeNull before returning.
Implementation
@override
Map<String, dynamic> toJson() {
return JsonClass.removeNull({
'backgroundColor': ThemeEncoder.encodeColor(
backgroundColor,
),
'color': ThemeEncoder.encodeColor(
color,
),
'semanticsLabel': semanticsLabel,
'semanticsValue': semanticsValue,
'strokeAlign': CircularProgressIndicator.strokeAlignCenter == strokeAlign
? null
: strokeAlign,
'strokeCap': strokeCap,
'strokeWidth': 4.0 == strokeWidth ? null : strokeWidth,
'value': value,
'valueColor': null == valueColor ? null : valueColor,
...args,
});
}