encodeRangeSliderTrackShape static method

String? encodeRangeSliderTrackShape(
  1. RangeSliderTrackShape? value
)

Encodes the given value to the String representation. Supported values are:

  • rectangular
  • rounded

All other values, including null, will result in null.

Implementation

static String? encodeRangeSliderTrackShape(RangeSliderTrackShape? value) {
  assert(value == null ||
      value is RectangularRangeSliderTrackShape ||
      value is RoundedRectRangeSliderTrackShape);
  String? result;

  if (value != null) {
    if (value is RectangularRangeSliderTrackShape) {
      result = 'rectangular';
    } else if (value is RoundedRectRangeSliderTrackShape) {
      result = 'rounded';
    }
  }

  return result;
}