encodeDrawerThemeData static method
Encodes the given value
to a JSON compatible Map. The returned result
will always have the following format:
{
"backgroundColor": "<Color>",
"elevation": "<double>",
"scrimColor": "<Color>",
"shadowColor": "<Color>",
"shape": "<ShapeBorder>",
"surfaceTintColor": "<Color>",
"width": "<double>"
}
See also:
Implementation
static Map<String, dynamic>? encodeDrawerThemeData(
DrawerThemeData? value, {
bool validate = true,
}) {
Map<String, dynamic>? result;
if (value != null) {
result = {
'backgroundColor': encodeColor(value.backgroundColor),
'elevation': value.elevation,
'scrimColor': encodeColor(value.scrimColor),
'shadowColor': encodeColor(value.shadowColor),
'shape': encodeShapeBorder(value.shape),
'surfaceTintColor': encodeColor(value.surfaceTintColor),
'width': value.width,
};
}
return _stripNull(result);
}