GF Checkbox Widget for Flutter
It allows you to speed up your Flutter app development by 20-30%. It has almost all widget that allows you to enhance your Flutter UI design and speed up flutter development with fully customizable features.Now here is i am going to talk about what is GetWidget Checkbox widget and how we implement this on Flutter app to build awesome Flutter Checkbox widget for an app.So, are you ready to make use of this widget package in the Flutter application? If so, then let's quickly jump into the usage and the ways a Checkbox can be modified and used to make user-friendly apps. Here I am going to use an open-source UI Library known as GetWidget to build this Checkbox widget in Flutter.
How to Get Started
Now here is the guide about how we should start developing GFCheckbox Widget with the use of GetWidget UI Library. Getting started will guide you on how to start building a beautiful flutter application with GetWidget UI library. You have to install the package from pub.dev, import the package in your Flutter project.Install Package from pub.dev :https://pub.dev/packages/getwidget
Import full package:
import 'package:getwidget/getwidget.dart'; Note: dependencies: getwidget: ^ 4.0.0Keep playing with the pre-built UI components.GFCheckBox is a Flutter Checkbox that is a material widget that allows users to select one option from the set of given options. The user can select one or multiple at a time depending on the situation. The checkbox is a binary value with yes and no. The value is checked if it is yes and unchecked if it is no. Let us now see the different types of GFCheckBox in the below section
Flutter Basic Checkbox
This is a basic or standard type of checkbox. It has a slight border radius around it. By using the below code we can design a basic Checkbox.bool isChecked = false;
GFCard(
content: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GFCheckbox(
activeBgColor: Colors.red,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
GFCheckbox(
activeBgColor: Colors.blue,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
GFCheckbox(
size: GFSize.SMALL,
activeBgColor: Colors.green,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
],
),
),
Flutter Square Checkbox
This is a square type of checkbox. It doesn't have any border radius. We use GFCheckboxType.square to make it of type square. Use the below code to make a square Checkbox.bool isChecked = true;
GFCard(
content: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GFCheckbox(
size: GFSize.LARGE,
activeBgColor: Colors.red,
type: GFCheckboxType.square,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
GFCheckbox(
type: GFCheckboxType.square,
activeBgColor: Colors.blue,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
GFCheckbox(
size: GFSize.SMALL,
activeBgColor: Colors.green,
type: GFCheckboxType.square,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
],
),
),
Flutter Circular Checkbox
This is a circular type checkbox. The shape is of a circle or round as shown in the below image. Add type GFCheckboxType.circle to make it a circle. Use the below example to show the Flutter circular Checkbox.bool isChecked = false;
GFCard(
content: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GFCheckbox(
size: GFSize.LARGE,
activeBgColor: Colors.red,
type: GFCheckboxType.circle,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
GFCheckbox(
type: GFCheckboxType.circle,
activeBgColor: Colors.blue,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
),
GFCheckbox(
activeBgColor: Colors.green,
size: GFSize.MEDIUM,
type: GFCheckboxType.circle,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
],
),
),
Flutter Custom Checkbox Widget With Icon
The Custom CheckBox can have an icon or background image as the check value shown in the image below. We can customize the widget by using its property. Use the below example to make a custom Checkbox.bool isChecked = true;
GFCard(
content: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: [
GFCheckbox(
size: GFSize.LARGE,
type: GFCheckboxType.custom,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: null,
),
GFCheckbox(
type: GFCheckboxType.square,
activeBgColor: Colors.purple,
activeIcon: Icon(Icons.sentiment_satisfied),
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
inactiveIcon: Icon(Icons.sentiment_dissatisfied),
),
GFCheckbox(
size: GFSize.SMALL,
type: GFCheckboxType.custom,
onChanged: (value) {
setState(() {
isChecked = value;
});
},
value: isChecked,
custombgColor: Colors.blue,
),
],
),
),
Flutter Checkbox Widget Custom Properties
The look and feel of the Flutter Checkbox can be customized using the GFCheckbox properties.| type | type of [GFCheckboxType] which is of four type is basic, square, circular and custom |
| size | type of [double] which is GFSize ie, small, medium and large and can use any double value |
| activeBgColor | type of [Color] used to change the backgroundColor of the active checkbox |
| inactiveBgColor | type of [Color] used to change the backgroundColor of the inactive checkbox |
| activeBorderColor | type of [Color] used to change the border color of the active checkbox |
| inactiveBorderColor | type of [Color] used to change the border color of the inactive checkbox |
| onChanged | called when the user checks or unchecks the checkbox. |
| value | used to set the current state of the checkbox |
| activeIcon | type of [Widget] used to change the checkbox's active icon |
| inactiveIcon | type of [Widget] used to change the checkbox's inactive icon |
| customBgColor | type of [Color] used to change the background color of the custom active checkbox only |
| autofocus | on true state this widget will be selected as the initial focus when no other node in its scope is currently focused |
| focusNode | an optional focus node to use as the focus node for this widget. |
Can we change the tick mark?
Yes, we can change the tick mark by using its customizable property.How to change the size of the CheckBox
The size can be changed using the size property and the GFCheckBox has small, medium, and large by default. The user can also change according to the need by giving the double value. Flutter Get Widget DocsFlutter GetWidget Docs
Get Widget is one of the largest Flutter open-source UI Kit libraries for mobile or web apps. It has more than 1000+ pre-built reusable widgets.


