encodeScrollbarThemeData static method

Map<String, dynamic>? encodeScrollbarThemeData(
  1. ScrollbarThemeData? value
)

Encodes the given ScrollbarThemeData to the JSON representation. This produces the following structure:

{
  "crossAxisMargin": "<double>",
  "interactive": "<bool>",
  "mainAxisMargin": "<double>",
  "minThumbLength": "<double>",
  "radius": "<Radius>",
  "thickness": "<MaterialStateProperty<double>>",
  "thumbColor": "<MaterialStateProperty<Color>>",
  "thumbVisibility": "<MaterialStateProperty<bool>>",
  "trackBorderColor": "<MaterialStateProperty<Color>>",
  "trackColor": "<MaterialStateProperty<Color>>",
  "trackVisibility": "<MaterialStateProperty<bool>>"
}

See also:

Implementation

static Map<String, dynamic>? encodeScrollbarThemeData(
  ScrollbarThemeData? value,
) {
  Map<String, dynamic>? result;

  if (value != null) {
    result = {
      'crossAxisMargin': value.crossAxisMargin,
      'interactive': value.interactive,
      'mainAxisMargin': value.mainAxisMargin,
      'minThumbLength': value.minThumbLength,
      'radius': encodeRadius(value.radius),
      'thickness': encodeMaterialStatePropertyDouble(
        value.thickness,
      ),
      'thumbColor': encodeMaterialStatePropertyColor(value.thumbColor),
      'thumbVisibility': encodeMaterialStatePropertyBool(
        value.thumbVisibility,
      ),
      'trackBorderColor': encodeMaterialStatePropertyColor(
        value.trackBorderColor,
      ),
      'trackColor': encodeMaterialStatePropertyColor(value.trackColor),
      'trackVisibility': encodeMaterialStatePropertyBool(
        value.trackVisibility,
      ),
    };
  }

  return _stripNull(result);
}