如何增加 Flutter 中 Switch 的拇指大小

问题描述 投票:0回答:1

我希望以下拇指大小与给定图像相匹配。

inactive switch sample active switch sample

但是开关在活动和非活动模式下看起来是这样的。

this how my code makes it look

这是代码:

Switch(
        value: value,
        onChanged: (){},
        trackOutlineWidth: 0,
        trackOutlineColor: value
            ? blue
            : grey,
        activeTrackColor: blue,
        inactiveThumbColor: white,
        inactiveTrackColor: grey,
      ),

我应该添加/修改什么才能使其符合设计?

flutter material-ui uiswitch
1个回答
0
投票

不确定是否有更好的方法,因为这感觉有点像解决方法,但给它这个拇指图标似乎有效:

thumbIcon: MaterialStateProperty.all(const Icon(null)),
© www.soinside.com 2019 - 2024. All rights reserved.