Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/ketanchoyal/custom_radio_grouped_button
Custom Flutter widgets that makes Checkbox and Radio Buttons much cleaner and easier.
https://github.com/ketanchoyal/custom_radio_grouped_button
android-application dart flutter flutter-ui flutter-widget hacktoberfest ios-app
Last synced: 2 days ago
JSON representation
Custom Flutter widgets that makes Checkbox and Radio Buttons much cleaner and easier.
- Host: GitHub
- URL: https://github.com/ketanchoyal/custom_radio_grouped_button
- Owner: ketanchoyal
- License: mit
- Created: 2019-08-17T17:28:44.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-09-22T16:52:09.000Z (over 1 year ago)
- Last Synced: 2024-12-31T09:11:56.730Z (9 days ago)
- Topics: android-application, dart, flutter, flutter-ui, flutter-widget, hacktoberfest, ios-app
- Language: Dart
- Homepage:
- Size: 2.15 MB
- Stars: 150
- Watchers: 5
- Forks: 42
- Open Issues: 8
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Funding: .github/FUNDING.yml
- License: LICENSE
Awesome Lists containing this project
README
# custom_radio_grouped_button
[![Pub](https://img.shields.io/pub/v/custom_radio_grouped_button)](https://pub.dartlang.org/packages/custom_radio_grouped_button)
Custom Radio Buttons and Grouped Check Box Button
Custom Flutter widgets that makes Checkbox and Radio Buttons much cleaner and easier
## Installing
Add the following to your `pubspec.yaml` file:
dependencies:
custom_radio_grouped_button: any# Creating Radio Button
CustomRadioButton(
elevation: 0,
absoluteZeroSpacing: true,
unSelectedColor: Theme.of(context).canvasColor,
buttonLables: [
'Student',
'Parent',
'Teacher',
],
buttonValues: [
"STUDENT",
"PARENT",
"TEACHER",
],
buttonTextStyle: ButtonTextStyle(
selectedColor: Colors.white,
unSelectedColor: Colors.black,
textStyle: TextStyle(fontSize: 16)),
radioButtonValue: (value) {
print(value);
},
selectedColor: Theme.of(context).accentColor,
),# Creating Grouped Button
CustomCheckBoxGroup(
buttonTextStyle: ButtonTextStyle(
selectedColor: Colors.red,
unSelectedColor: Colors.orange,
textStyle: TextStyle(
fontSize: 16,
),
selectedTextStyle: TextStyle(
fontSize: 20,
fontWeight: FontWeight.w700,
),
),
unSelectedColor: Theme.of(context).canvasColor,
buttonLables: [
"M",
"T",
"W",
"T",
"F",
"S",
"S",
],
buttonValuesList: [
"Monday",
"Tuesday",
"Wednesday",
"Thursday",
"Friday",
"Saturday",
"Sunday",
],
checkBoxButtonValues: (values) {
print(values);
},
spacing: 0,
defaultSelected: "Monday",
horizontal: false,
enableButtonWrap: false,
width: 40,
absoluteZeroSpacing: false,
selectedColor: Theme.of(context).accentColor,
padding: 10,
);# Changing values Programiically
You can acces the widget's state using `Key` now
Example: Create a key for the CustomRadioButton widget
final key = new GlobalKey>();
now to change the value of the widget pass the value to the `selectButton` method
key.currentState.selectButton();
Similarly for the CustomCheckBoxGroup widget
final key = new GlobalKey>();
key.currentState.selectButton();
## Screenshots