encodeMaterialStatePropertySize static method

Map<String, dynamic>? encodeMaterialStatePropertySize(
  1. MaterialStateProperty<Size?>? value, {
  2. bool validate = true,
})

Encodes the value into a JSON representation.

{
  "disabled": <Size>,
  "dragged": <Size>,
  "empty": <Size>,
  "error": <Size>,
  "focused": <Size>,
  "hovered": <Size>,
  "pressed": <Size>,
  "selected": <Size>
}

See also:

Implementation

static Map<String, dynamic>? encodeMaterialStatePropertySize(
  MaterialStateProperty<Size?>? value, {
  bool validate = true,
}) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = {
      'disabled': encodeSize(value.resolve({MaterialState.disabled})),
      'dragged': encodeSize(value.resolve({MaterialState.dragged})),
      'empty': encodeSize(value.resolve({})),
      'error': encodeSize(value.resolve({MaterialState.error})),
      'focused': encodeSize(value.resolve({MaterialState.focused})),
      'hovered': encodeSize(value.resolve({MaterialState.hovered})),
      'pressed': encodeSize(value.resolve({MaterialState.pressed})),
      'selected': encodeSize(value.resolve({MaterialState.selected})),
    };
  }

  return result;
}