0

I am using -> SfSlider library to create a slider. To change the size of thumb, i just change the thumbIcon inside it by creating a Container(height:20, width:10,).

But i think its height and width are not reflecting when i change the Container() height and width, these are changing only when i change the thumbRadius.

I am getting below result-

enter image description here

But i want below result -

enter image description here

How to do that? My flutter code is below :

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);
                        });
                      },
                    ),
                  ),
                ),
              ),
Rakesh Saini
  • 660
  • 2
  • 7
  • 20

0 Answers0