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({
'alignment': ThemeEncoder.encodeWrapAlignment(
alignment,
),
'clipBehavior': ThemeEncoder.encodeClip(
clipBehavior,
),
'crossAxisAlignment': ThemeEncoder.encodeWrapCrossAlignment(
crossAxisAlignment,
),
'direction': ThemeEncoder.encodeAxis(
direction,
),
'runAlignment': ThemeEncoder.encodeWrapAlignment(
runAlignment,
),
'runSpacing': runSpacing,
'spacing': spacing,
'textDirection': ThemeEncoder.encodeTextDirection(
textDirection,
),
'verticalDirection': ThemeEncoder.encodeVerticalDirection(
verticalDirection,
),
'children': JsonClass.maybeToJsonList(children),
...args,
});
}