Flutter increase height and width of Switch?

Kathir vtv picture Kathir vtv · Sep 29, 2018 · Viewed 7.9k times · Source

I creating game with single and two players. for selection i want slide look so i have tried with switch method but its look very small. how to increase height and width of switch? is there any way creating look like this is welcome?

    new Center(
      child:
      new Padding(padding:EdgeInsets.all(50.00),
          child:
        new Column(
        mainAxisSize: MainAxisSize.max,
          children: <Widget>[
            new Switch(value: _value, onChanged: (bool value1)

            {
              _value=value1;

            },
              materialTapTargetSize: MaterialTapTargetSize.shrinkWrap,
              activeThumbImage: new AssetImage("assets/Images/1.png"),
              inactiveThumbImage: new AssetImage("assets/Images/1.png"),

            )
          ],
        )           ,
     ),
    )

enter image description here

Answer

diegoveloper picture diegoveloper · Sep 29, 2018

You could wrap your Switch inside a Transform widget and change the scale.

        Transform.scale( scale: 2.0,
                          child: new Switch(
                            value: true,
                            onChanged: (bool value1) {},
                          ),
                        )

Scale = 1 is the default size , 0.5 half size , 2.0 double size, you can play with the values :)