mardi 16 mars 2021

Can I put the checkbox and textformfield in line with flutter?

I'm new to flutter, and right now I'm trying to do something similar to this: img 1.
Where the textformfield is aligned inline with the checkbox, and the checkbox is shrunk at the corner, but the max that I can do is this: img 2.
Where the checkbox is filling half of the screen, I've tried to expand the textformfield in several ways, like sizedbox, flex and expand, but none of then made the checkbox shrink to the corner and the textformfield expand, the line is always split in the middle. The actual row code looks like this:

Row(
    children: [
              Expanded(
                  child: TextFormField(
                    style: TextStyle(
                        fontSize: 20
                    ),
                    decoration: InputDecoration(
                      hintText: "Senha",

                    ),
                    autocorrect: false,
                    obscureText: true,
                  ),
                ),
              Flexible(

                  child: SizedBox(
                    width: 10,
                    child: Checkbox(value: true, onChanged: (value){}),
                )
              )
            ],
          ),

Is there any way for me to do this? Do I have to use a container or something like that?
Any help would be appreciated.




Aucun commentaire:

Enregistrer un commentaire