Home > database >  LabeledCheckbox (Checkbox) on the left side of the text in Flutter?
LabeledCheckbox (Checkbox) on the left side of the text in Flutter?

Time:08-24

I'm using CheckboxListTile, by default the checkbox is to the right of the text. How do I move the checkbox to the left of the text?

My code:

 @override
   Widget build(BuildContext context) {
     return LabeledCheckbox(
       label: 'Text of my Checkbox',
       padding: const EdgeInsets.symmetric(horizontal: 20.0),
       value: _isSelected,
       onChanged: (bool newValue) {
         setState(() {
           _isSelected = newValue;
         });
       },
     );
   }

Preview:

enter image description here

CodePudding user response:

To make the checkbox appear on the left of the text, you can wrap your widget with a enter image description here

  • Related