animated_switch 0.0.1 copy "animated_switch: ^0.0.1" to clipboard
animated_switch: ^0.0.1 copied to clipboard

outdated

Custom animated swith with animated color, text and 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

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 #

11
likes
0
pub points
85%
popularity

Publisher

verified publishervazquezmarcos.es

Custom animated swith with animated color, text and icons

Repository (GitHub)
View/report issues

License

unknown (LICENSE)

Dependencies

flutter

More

Packages that depend on animated_switch