'Checkbox Position in flutter

How can i change the position of checkbox on top left side of my title, in checkboxlisttile

enter image description here



Solution 1:[1]

class CheckBoxExample extends StatefulWidget {
  const CheckBoxExample({Key? key}) : super(key: key);

  @override
  State<CheckBoxExample> createState() => _CheckBoxExampleState();
}

class _CheckBoxExampleState extends State<CheckBoxExample> {
  bool _isChecked = false;

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      backgroundColor: Colors.amber,
      body: Column(
        crossAxisAlignment: CrossAxisAlignment.center,
        mainAxisAlignment: MainAxisAlignment.start,
        children: [
          const SizedBox(height: 150),
          CheckboxListTile(
            value: _isChecked,
            selected: _isChecked,
            contentPadding: EdgeInsets.zero,
            onChanged: (v) {
              setState(() {
                print(v);
                _isChecked = v!;
              });
            },
            title: Text(
              'How can i change the position of checkbox on top left side of my title, in checkboxlisttile',
              maxLines: 5,
            ),
            controlAffinity: ListTileControlAffinity.leading,
          ),
        ],
      ),
    );
  }
}

enter image description here

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 DiyorbekDev