どうも、ちょげ(@chogetarou)です。
AlertDialogを画面の下に表示する方法を紹介します。
方法

AlertDialogを画面の下に表示するには、まず「AlertDialog」をColumnウェジェットの「childeren」に指定します。
showDialog(
context: context,
builder: (BuildContext context) {
return Column(
children: [
AlertDialog(
title: Text('Alert'),
content: Text('This is sample.'),
),
],
);
},
);
そして、Columnウェジェットの引数「mainAxisAlignment」に、「MainAxisAlignment.end」を指定します。
showDialog(
context: context,
builder: (BuildContext context) {
return Column(
mainAxisAlignment: MainAxisAlignment.end,
children: [
AlertDialog(
title: Text('Alert'),
content: Text('This is sample.'),
),
],
);
},
);

コメント