toJson method
Converts this style into a serializable JSON representation.
Example output:
{
"backgroundColor": "#007cba",
"textStyle": {
"color": "#ffffff",
"fontWeight": "w600",
"fontSize": 16.0
},
"hoverColor": "#0056b3"
}
Implementation
Map<String, dynamic> toJson() => {
'backgroundColor': backgroundColor,
'disabledColor': disabledColor,
'textStyle': textStyle.toJson(),
'border': border?.toJson(),
'hoverColor': hoverColor,
};