encodeScrollbarThemeData static method
Encodes the given ScrollbarThemeData to the JSON representation. This produces the following structure:
{
"crossAxisMargin": <double>,
"interactive": <bool>,
"isAlwaysShown": <bool>,
"mainAxisMargin": <double>,
"minThumbLength": <double>,
"radius": <Radius>,
"showTrackOnHover": <bool>,
"thickness": <MaterialStateProperty<double>>,
"thumbColor": <MaterialStateProperty<Color>>,
"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,
'isAlwaysShown': value.isAlwaysShown,
'mainAxisMargin': value.mainAxisMargin,
'minThumbLength': value.minThumbLength,
'radius': encodeRadius(value.radius),
'showTrackOnHover': value.showTrackOnHover,
'thickness': encodeMaterialStatePropertyDouble(
value.thickness,
),
'thumbColor': encodeMaterialStatePropertyColor(value.thumbColor),
'trackBorderColor': encodeMaterialStatePropertyColor(
value.trackBorderColor,
),
'trackColor': encodeMaterialStatePropertyColor(value.trackColor),
'trackVisibility': encodeMaterialStatePropertyBool(
value.trackVisibility,
),
};
}
return _stripNull(result);
}