encodeDrawerThemeData static method

Map<String, dynamic>? encodeDrawerThemeData(
  1. DrawerThemeData? value, {
  2. bool validate = true,
})

Encodes the given value to a JSON compatible Map. The returned result will always have the following format:

{
  "backgroundColor": "<Color>",
  "elevation": "<double>",
  "endShape": "<ShapeBorder>",
  "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,
      'endShape': encodeShapeBorder(value.endShape),
      'scrimColor': encodeColor(value.scrimColor),
      'shadowColor': encodeColor(value.shadowColor),
      'shape': encodeShapeBorder(value.shape),
      'surfaceTintColor': encodeColor(value.surfaceTintColor),
      'width': value.width,
    };
  }

  return _stripDynamicNull(result);
}