Skip to content

asknishant/flipping_button

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

flipping_button

This is an animated flip button widget created for toggling between two different values.


pub package MIT License LinkedIn

Installation

pubspec.yaml:

dependencies:
  flipping_button: ^1.1.0
 

Import the package

dependencies:
  flipping_button: ^1.1.0

Example

class HomePage extends StatelessWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      home: Scaffold(
        backgroundColor: Colors.amber,
        body: Center(
          child: FlippingButton(
            textStyle: TextStyle(
                color: Colors.green, fontSize: 20, fontWeight: FontWeight.bold),
            color: Colors.blue,
            background: Colors.yellow,
            leftLabel: 'Left',
            rightLabel: 'Right',
            onChange: (bool isLeftActive) {
              //Switch between tabs or do any other task.
            },
            btnWidth: 250,
            radius: 32,
            btnHeight: 64,
          ),
        ),
      ),
    );
  }
}
 

All named arguments

class FlippingButton extends StatefulWidget {
  final Color color;
  final Color background;
  final String leftLabel;
  final String rightLabel;
  final double btnWidth;
  final double btnHeight;
  final TextStyle textStyle;
  final double radius;
  final void Function(bool isLeftActive) onChange;

  const FlippingButton({
    Key key,
    this.color,
    this.btnWidth,
    this.btnHeight,
    this.background,
    this.leftLabel,
    this.rightLabel,
    this.onChange,
    this.textStyle,
    this.radius,
  }) : super(key: key);  
}

License

Distributed under the MIT License. See LICENSE for more information.

Contact

Email - asknishant.39@gmail.com

Project Link: Github

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages