0
Inside a alertDialog I created a column with the checkbox and then a Row with two Flatbutton, however they are side by side and I need them to be below the checkbox.
Code
AlertDialog(
...
actions: <Widget>[
Container(
color: Colors.green,
child: Column(
children: <Widget>[
Row(
children: <Widget>[
Checkbox(
value: false,
),
Text("Teste 123"),
],
),
Row(
children: <Widget>[
Checkbox(
value: false,
),
Text("Teste 0321"),
],
),
],
),
),
Container(
color: Colors.blue,
child: Column(
children: <Widget>[
Row(
mainAxisAlignment: MainAxisAlignment.end,
children: <Widget>[
FlatButton(
child: Text(
AppLocalizations.of(context).cancel.toUpperCase(),
),
),
FlatButton(
child: Text(
AppLocalizations.of(context).send.toUpperCase(),
),
),
],
),
],
),
),
],
I managed to get the expected result just involving the column with a container and raising its width to the maximum screen, but this leaves the pattern of the other dialogs of the app and makes it wrong depending on the device.
Where is the code of the rest of the alertDialog? What will you do with the Checkbox? I believe the idea of this property
Actions
is only for the buttons that are at the bottom of the screen. Some reason for you not to put the Checkbox’s inside thecontent
?– Naslausky
That’s what Flutter does is right... You’re putting one
Container
with the checkbox’s inside theActions
(Which is for Action buttons), the right is to move these checkbox’s into the body of the dialog and let them align to the Bottom.– Matheus Ribeiro
Really bro, I thought I didn’t need to put all the code since all my elements were in the actions. I tried to do what you said about putting the components in the content and it worked super well here, if you want can comment on the answer I put as correct. Thank you !!
– Jonatan Rocha
Yes @Matheusribeiro, but it is wrong to learn, it was my first experiment with this component, but I also believe it was lack of attention of mine when reading the documentation. Anyway thanks!!
– Jonatan Rocha