labeled_widgets 1.0.1 copy "labeled_widgets: ^1.0.1" to clipboard
labeled_widgets: ^1.0.1 copied to clipboard

Label the 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;
    });
  },
),

LabeledSwitch

bool _switchValue = false;

LabeledSwitch(
    label: 'Label',
    value: _switchValue,
    labelCheckColor: Colors.blue,
    onChanged: (value) {
        setState(() {
          _switchValue = value;
        });
    },
),

LabeledCupertinoSwitch

bool _cupertinoSwitchValue = false;

LabeledCupertinoSwitch(
    label: 'Label',
    value: _cupertinoSwitchValue,
    labelCheckColor: Colors.blue,
    onChanged: (value) {
        setState(() {
          _cupertinoSwitchValue = value;
        });
    },
),

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;
        });
    },
),
0
likes
110
pub points
43%
popularity

Publisher

unverified uploader

Label the widgets

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (LICENSE)

Dependencies

flutter

More

Packages that depend on labeled_widgets