getPreferredSize method
Returns the preferred size of the shape, based on the given conditions.
Implementation
@override
Size getPreferredSize(bool isEnabled, bool isDiscrete) {
onThumbSizeChange?.call(thumbSize); // 通过回调返回 thumb 大小
return Size(thumbSize, thumbSize); // 返回 thumb 的尺寸
}