encodeRangeSliderThumbShape static method

Map<String, dynamic>? encodeRangeSliderThumbShape(
  1. RoundRangeSliderThumbShape? value
)

Encodes the given value to a JSON representation. This only supports the following subclasses:

  • RoundRangeSliderThumbShape

The structure of the other attributes depends on the subclass.

Type: round

{
  "disabledThumbRadius": <double>,
  "elevation": <double>,
  "enabledThumbRadius": <double>,
  "pressedElevation": <double>,
  "type": "round"
}

Implementation

static Map<String, dynamic>? encodeRangeSliderThumbShape(
  RoundRangeSliderThumbShape? value,
) {
  assert(value == null || value is RoundRangeSliderThumbShape);
  Map<String, dynamic>? result;

  if (value != null) {
    result = <String, dynamic>{
      'disabledThumbRadius': value.disabledThumbRadius,
      'elevation': value.elevation,
      'enabledThumbRadius': value.enabledThumbRadius,
      'pressedElevation': value.pressedElevation,
      'type': 'round',
    };
  }

  return _stripNull(result);
}