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

Time:11-12

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;
                                  });
                                })),
                          )

CodePudding user response:

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;
                });
              })),
        ),
      ),
  • Related