0 purchases
crea radio button
CreaRadioButton - an easy radio button group #
A package to create simple radio buttons.
Example #
Change border on slected #
Change background color on selected #
Unselect is enabled #
Features #
Render a radio button group:
with any number of buttons
vertical or horizontal
square or round
Limitations #
Currently only supports String as value and button label. An option for RadioGroup is passed via class RadioOption.
Getting started #
To use this plugin, add crea_radio_button as a dependency in your pubspec.yaml file.
RadioButtonGroup #
String radioButtonInput = "";
RadioButtonGroup(
buttonHeight: 35,
buttonWidth: 60,
circular: true,
mainColor: Colors.grey,
selectedColor: Colors.pink.shade400,
preSelectedIdx: defaultOptionIndex,
options: [
RadioOption("10.0", "10"),
RadioOption("25.0", "25"),
RadioOption("50.0", "50"),
RadioOption("100.0", "100")
],
callback: (RadioOption val) {
setState(() {
selectedOption = val;
});
})
copied to clipboard
Default selection #
By default none of the options is preselected. You can specify index of the option you want to be preselected/
defaultIdx: 0
Add Border for seleted option #
By default there is no Border on a button. `selectedBorderSide can be used to add border for the selected option.
Callback #
Callback function returns the selected RadioOption
String radioButtonInput = "";
RadioButtonGroup(
vertical: true,
options: [
RadioOption("1", "1"),
RadioOption("2", "2"),
RadioOption("3", "3")
],
buttonHeight: 50,
buttonWidth: 50,
defaultIdx: defaultRadioIdx,
callback: (val) {
setState(() {
radioButtonInput = val.text;
});
});
copied to clipboard
Additional information #
Contribute here: https://github.com/dutkaD/crea_radio
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.