encodeIcon static method
Encodes the given value
to the JSON representation.
{
"color": "<Color>",
"fill": "<double>",
"grade": "<double>",
"icon": "<IconData>",
"opticalSize": "<double>",
"semanticLabel": "<String>",
"shadows": "<List<Shadow>>",
"size": "<double>",
"textDirection": "<TextDirection>",
"weight": "<double>"
}
Implementation
static Map<String, dynamic>? encodeIcon(Icon? value) {
Map<String, dynamic>? result;
if (value != null) {
result = {
'color': encodeColor(value.color),
'fill': value.fill,
'grade': value.grade,
'icon': encodeIconData(value.icon),
'opticalSize': value.opticalSize,
'semanticLabel': value.semanticLabel,
'shadows': value.shadows?.map((e) => encodeShadow(e)).toList(),
'size': value.size,
'textDirection': encodeTextDirection(value.textDirection),
'weight': value.weight,
};
}
return _stripDynamicNull(result);
}