encodeRangeSliderTickMarkShape static method

Map<String, dynamic>? encodeRangeSliderTickMarkShape(
  1. RangeSliderTickMarkShape? value
)

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

  • RoundRangeSliderTickMarkShape

The structure of the other attributes depends on the subclass.

RoundRangeSliderTickMarkShape

{
  "tickMarkRadius": "<double>",
  "type": "round"
}

Implementation

static Map<String, dynamic>? encodeRangeSliderTickMarkShape(
  RangeSliderTickMarkShape? value,
) {
  assert(value == null || value is RoundRangeSliderTickMarkShape);
  Map<String, dynamic>? result;

  if (value != null) {
    final shape = value as RoundRangeSliderTickMarkShape;
    result = <String, dynamic>{
      'tickMarkRadius': shape.tickMarkRadius,
      'type': 'round',
    };
  }

  return _stripDynamicNull(result);
}