Home > Back-end >  How to increase width of Switch in flutter?
How to increase width of Switch in flutter?

Time:11-21

I want to create a Switch like below : enter image description here

I tried using Transform.scale as parent Widget but it doesn't match with that i want. How should I increase Switch width? or any other suggestion for create similar(like Toggle or ...)?

CodePudding user response:

As far as I know, you only can increase size of Switch with Tranform.scale, can't increase only width like you want. If you really need that Switch, try use this package flutter_switch like this :

FlutterSwitch(
  width: 300,
  height: 30.0,
  value: true,
  onToggle: (val) {},
)

CodePudding user response:

Using SizedBox and FittedBox should do the trick

Same problem discussed here

  • Related