Skip to content

cyberpwnn/dart_animated_switcher

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Simple widget switches with animation

Usage

class SomeWidget extends StatefulWidget {
  const SomeWidget({Key? key}) : super(key: key);

  @override
  State<SomeWidget> createState() => _SomeWidgetState();
}

class _SomeWidgetState extends State<SomeWidget> {
  bool switched = false;
  @override
  Widget build(BuildContext context) => Column(
    children: [
      animatedSwitch(Container(
        width: 100,
        height: 100,
        color: switched ? Colors.blue : Colors.red,
      ), 1000),
      SwitchListTile(
          value: switched,
          onChanged: (f) => setState(() {
            switched = f;
          }))
    ],
  );
}

About

Simple animation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages