Home > database >  Flutter checkbox inside textfield
Flutter checkbox inside textfield

Time:10-07

I was wondering how I could recreate the Samsung Notes App. To be more precise I want to have the checkbox functionality within the textfield. See picture below:

Checkboxes

Thanks for your support!

CodePudding user response:

I've just tried it myself and this looks like how you want it to look:

TextField(
  decoration: InputDecoration(
    prefixIcon: Checkbox(value: value, onChanged: (value) {//bool magic here}),
    hintText: 'TextField'
  ),
),

Check out https://api.flutter.dev/flutter/material/InputDecoration-class.html for more InputDecoration() options to prettify things.

CodePudding user response:

if I understood you correctly you can use Textformfield. You can add the checkbox widget to the textformfield prefix parameter. I hope this gives you an idea and helps.

  • Related