I want to display an AlertDialog in Flutter with 3 buttons, but vertically aligned as the text of the buttons takes up too much space. So far I only get them displayed horizontally. Any idea how to solve it? The solutions from this post (How to make an AlertDialog in Flutter?) didn't work for me, still shown horizontally.
static Future<void> showLogoutAllDevicesOrOnlyThisDialog(
BuildContext context) {
var b1 = FlatButton(
textColor: Colors.red,
child: Text('Only on this device'),
onPressed: () {
Navigator.of(context).pop();
RxBus.post(HideSpinnerEvent());
},
);
var b2 = FlatButton(
textColor: Colors.red,
child: Text('On all devices'),
onPressed: () {
Navigator.of(context).pop();
RxBus.post(HideSpinnerEvent());
},
);
var b3 = FlatButton(
child: Text('Cancel'),
onPressed: () {
Navigator.of(context).pop();
},
);
return showDialog<void>(
context: context,
builder: (BuildContext context) {
return AlertDialog(
title: Text(''),
content: Text(
"Möchtest du dich auf allen Geräten abmelden oder nur auf diesem Gerät?"),
actions: <Widget>[
b1, b2, b3
],
);
},
);
}
}