How to change the size and angel in Switch widget , flutter

Here if use Transform.rotate you can change angle not scale .? any solution

   Transform.rotate(
                            angle: pi / 2,
                            scale: 2  <----
                            child: Switch.adaptive(
                                activeTrackColor:
                                    Color.fromARGB(255, 96, 220, 102),
                                value: value,
                                onChanged: ((value) {
                                  setState(() {
                                    this.value = value;
                                  });
                                })),
                          )

>Solution :

You can wrap your widget with an other Transform.scale like this:

Transform.scale(
        scale: 2,
        child: Transform.rotate(
          angle: pi / 2,
          child: Switch.adaptive(
              activeTrackColor: Color.fromARGB(255, 96, 220, 102),
              value: value,
              onChanged: ((value) {
                setState(() {
                  this.value = value;
                });
              })),
        ),
      ),

Leave a Reply