animated_switch 0.0.2 icon indicating copy to clipboard operation
animated_switch: ^0.0.2 copied to clipboard

Custom animated swith - You can customize and animate the color, text and choose different status icons

Animated switch


Customizable animated switch widget for flutter apps
Custom Switch button made to allow you to customize colors, icons, and off/on text.

Manage the widget states in the same way you do with the classical material's switch widget.

style: lint


Quick Start #

Import this library into your project:

animated_switch: ^latest_version

Or do:

$ flutter pub add animated_switch

Basic Implementation #

Using the callback


AnimatedSwitch(
  onChanged: (bool state) {
    print('turned ${(state) ? 'on' : 'off'}');
  },
),

More possibilities

  • Change colors

      AnimatedSwitch(    
          ...
          colorOn: Colors.blue,
          colorOff: Colors.grey,
          indicatorColor: Colors.limeAccent,
      )
    

  • Change icons

      AnimatedSwitch(
          ...
          iconOff: Icons.lock_open,
          iconOn: Icons.lock,
      )
    

  • Create custom text indicators

      AnimatedSwitch(    
          ...
          textOn: "On",
          textOff: "Off",
          textStyle: TextStyle(color: Colors.white, fontSize: 20),
      )
    

Previews #

8
likes
140
pub points
71%
popularity

Publisher

verified publisher iconvazquezmarcos.es

Custom animated swith - You can customize and animate the color, text and choose different status icons

Repository (GitHub)

Documentation

API reference

License

Icon for licenses.MIT (LICENSE)

Dependencies

flutter

More

Packages that depend on animated_switch