0

我正在使用 -> SfSlider 库来创建一个滑块。要更改拇指的大小,我只需通过创建一个容器(高度:20,宽度:10,)来更改其中的拇指图标。

但我认为当我改变 Container() 高度和宽度时它的高度和宽度没有反映,这些只有在我改变 thumbRadius 时才会改变。

我得到低于结果-

在此处输入图像描述

但我想要以下结果 -

在此处输入图像描述

怎么做?我的颤振代码如下:

Container(
                child: SfSliderTheme(
                  data: SfSliderThemeData(
                      activeTrackHeight: 8,
                      thumbColor: Colors.transparent,
                      thumbRadius: 15,
                      thumbStrokeWidth: 0,
                      activeTrackColor: myColor,
                      inactiveTrackColor: Colors.black12,
                      thumbStrokeColor: Colors.black45,
                  ),
                  child: Center(
                    child: SfSlider(
                      showLabels: false,
                      value: _sliderValue,
                      min: 5000,
                      max: 500000,
                      interval: 1000,
                      thumbIcon:  Container(
                        height: 30.0,
                        width: 10,
                        decoration: BoxDecoration(
                            shape: BoxShape.rectangle,
                            color: myColor,
                            borderRadius: BorderRadius.all(Radius.circular(8.0))),

                      ),
                      onChanged: (value) {
                        setState(() {
                          _sliderValue = value;
                          print("slider value" + _sliderValue.toString());
                          // _amountController.text = value.floor().toString();
                          _amountController.text =
                              getChangedAmount(value.floor().toString());
                          // print("amount controller value" + _amountController.text);
                        });
                      },
                    ),
                  ),
                ),
              ),
4

0 回答 0