animated_switch 0.0.3 copy "animated_switch: ^0.0.3" to clipboard
animated_switch: ^0.0.3 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 #

15
likes
160
points
534
downloads

Publisher

verified publishervazquezmarcos.es

Weekly Downloads

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

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on animated_switch