A customizable circular checkbox which plays an animation when checked or unchecked. Inspired by BEMCheckbox for iOS.
-
Choose from 4 animation/visual styles (stroke, scale in checkmark, scale in background, fade in).
-
Customize colors for active, inactive and disabled states.
-
Customize the animation duration.
Install the package:
flutter pub add msh_checkbox
class Example extends StatefulWidget {
Example({Key? key}): super(key: key);
@override
State<Example> createState() => _ExampleState();
}
class _ExampleState extends State<Example> {
bool isChecked = false;
@override
Widget build(BuildContext context) {
return Center(
child: MSHCheckbox(
size: 60,
value: isChecked,
checkedColor: Colors.blue,
style: MSHCheckboxStyle.stroke,
onChanged: (selected) {
setState(() {
isChecked = selected;
});
},
),
);
}
}