Last updated:
0 purchases
labeled widgets
labeled_widgets #
Label the widgets, let click on the text also work. Now there are only four widgets: LabeledCheckBox, LabeledSwitch, LabeledCupertinoSwitch, LabeledRadio.
All parameters are exported, the usage method is exactly the same as the original widgets,
and four attributes are added to the label to simplify the use: labelColor, labelCheckColor, labelFontSize, labelFontWeight
LabeledCheckbox
bool? _checkboxValue = false;
LabeledCheckbox(
label: 'Label',
value: _checkboxValue,
labelCheckColor: Colors.blue,
onChanged: (value) {
setState(() {
_checkboxValue = value;
});
},
),
copied to clipboard
LabeledSwitch
bool _switchValue = false;
LabeledSwitch(
label: 'Label',
value: _switchValue,
labelCheckColor: Colors.blue,
onChanged: (value) {
setState(() {
_switchValue = value;
});
},
),
copied to clipboard
LabeledCupertinoSwitch
bool _cupertinoSwitchValue = false;
LabeledCupertinoSwitch(
label: 'Label',
value: _cupertinoSwitchValue,
labelCheckColor: Colors.blue,
onChanged: (value) {
setState(() {
_cupertinoSwitchValue = value;
});
},
),
copied to clipboard
LabeledRadio
int? _radioValue = 0;
LabeledRadio<int>(
label: 'Label 0',
value: 0,
groupValue: _radioValue,
labelCheckColor: Colors.blue,
onChanged: (value) {
setState(() {
_radioValue = value;
});
},
),
LabeledRadio<int>(
label: 'Label 1',
value: 1,
groupValue: _radioValue,
labelCheckColor: Colors.green,
onChanged: (value) {
setState(() {
_radioValue = value;
});
},
),
copied to clipboard
For personal and professional use. You cannot resell or redistribute these repositories in their original state.
There are no reviews.