[Flutter]AlertDialogの背景を透明にする方法

Flutter

どうも、ちょげ(@chogetarou)です。

AlertDialogの背景を透明にする方法を紹介します。

スポンサーリンク

方法

インターフェース, インターネット, プログラム, ブラウザ, Www, グラフィック, フラットなデザイン

AlertDialogの背景を透明にするには、まず引数「backgroudColor」に「Colors.transparent」を指定します。

そして、引数「elevation」に「0」を指定します。

AlertDialog(
  backgroundColor: Colors.transparent,
  elevation: 0,
  title: Text('Alert'),
  content: Text('This is sample.'),
);

コメント

タイトルとURLをコピーしました