どうも、ちょげ(@chogetarou)です。
AlertDialogを円にする方法を紹介します。
方法

AlertDialogを円にするには、引数「shape」に「CircleBorder」を指定します。
また、円にするとタイトルの位置がずれます。
なので、タイトルの位置を真ん中に調整します。
以下は、使用例です。
AlertDialog(
shape: CircleBorder(),
title: Align(
alignment: Alignment.center,
child: Text('Alert'),
),
content: Container(
width: 100,
height: 100,
),
),
まとめ
AlertDialogを円にするには、引数「shape」に「CircleBorder」を指定します。
コメント