import 'package:flutter/material.dart'; class RoundCheckBox extends StatefulWidget { bool value = false; final double size; final Color activeColor; final Color defaultColor; final Function(bool) onChanged; RoundCheckBox({Key key, @required this.value, this.onChanged, this.size, this.activeColor = Colors.white, this.defaultColor = Colors.white }) : super(key: key); @override _RoundCheckBoxState createState() => _RoundCheckBoxState(); } class _RoundCheckBoxState extends State { @override Widget build(BuildContext context) { return Center( child: GestureDetector( onTap: () { widget.value = !widget.value; widget.onChanged(widget.value); }, child: Padding( padding: const EdgeInsets.all(10.0), child: widget.value ? Icon( Icons.check_circle, size: widget.size, color: widget.activeColor, ) : Icon( Icons.panorama_fish_eye, size: widget.size, color: widget.defaultColor, ), )), ); } }