switcher_button 0.0.4 switcher_button: ^0.0.4 copied to clipboard
Flutter switch button with minimal design and material animation and highly customizable.It can be use as switch button or toggle buttons.
import 'package:flutter/material.dart';
import 'package:switcher_button/switcher_button.dart';
void main() {
runApp(MyApp());
}
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
title: 'Flutter Demo',
theme: ThemeData(
primarySwatch: Colors.blue,
),
home: MyHomePage(title: 'Home Page'),
);
}
}
class MyHomePage extends StatefulWidget {
MyHomePage({Key key, this.title}) : super(key: key);
final String title;
@override
_MyHomePageState createState() => _MyHomePageState();
}
class _MyHomePageState extends State<MyHomePage> {
@override
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
title: Text(widget.title),
),
body: Container(
color: Colors.orange,
child: Center(
child: SwitcherButton(
value: true,
onChange: (value) {
print(value);
},
),
),
),
);
}
}