For a custom switch. I used this package.
https://pub.dev/packages/flutter_switch
You can customize the height and width of the switch, the border radius of the switch, the colors, the toggle size, etc.
Install:
dependencies:
flutter_switch: ^0.0.2
Import:
import 'package:flutter_switch/flutter_switch.dart';
Sample Usage:
FlutterSwitch(
height: 20.0,
width: 40.0,
padding: 4.0,
toggleSize: 15.0,
borderRadius: 10.0,
activeColor: lets_cyan,
value: isToggled,
onToggle: (value) {
setState(() {
isToggled = value;
});
},
),