A animated and beautiful Switcher
In pubspec.yaml:
dependencies:
switcher: any
import 'package:switcher/switcher.dart';
Switcher(
value: false,
size: SwitcherSize.large,
switcherButtonRadius: 50,
enabledSwitcherButtonRotate: true,
iconOff: Icons.lock,
iconOn: Icons.lock_open,
colorOff: Colors.blueGrey.withOpacity(0.3),
colorOn: Colors.blue,
onChanged: (bool state) {
//
},
),
Switcher(
value: false,
size: SwitcherSize.large,
switcherButtonRadius: 50,
iconOff: null,
enabledSwitcherButtonRotate: false,
colorOff: Colors.blueGrey.withOpacity(0.3),
colorOn: Colors.blue,
onChanged: (bool state) {
//
},
),
// Switcher with labels
Switcher(
value: false,
size: SwitcherSize.large,
labelOff: Text('is off'), // label to display on off
labelOn: Text('is on'),// label to display on off
colorOff: Colors.indigo.withOpacity(0.3),
colorOn: Colors.indigo,
switcherButtonBoxShape: BoxShape.rectangle,
enabledSwitcherButtonRotate: false,
onChanged: (bool state) {
//
},
),
Please send feature requests and bugs at the issue tracker.