見出し画像

Flutterで角丸ダイアログを出す

こんなダイアログを出す方法は下記でいけました。

_showUserAlertDialog(DocumentSnapshot doc) {
    showDialog(
        context: context,
        builder: (_) {
          return AlertDialog(
            shape: const RoundedRectangleBorder(
                borderRadius: BorderRadius.all(Radius.circular(32.0))),
            contentPadding: EdgeInsets.only(top: 30.0),
            content: Container(
              width: 300,
              child: Column(
                mainAxisAlignment: MainAxisAlignment.start,
                crossAxisAlignment: CrossAxisAlignment.stretch,
                mainAxisSize: MainAxisSize.min,
                children: <Widget>[
                  Container(
                    width: 100,
                    height: 100,
                    child: CachedNetworkImage(
                      imageUrl: "url",
                    ),
                  ),
                  const SizedBox(
                    height: 30,
                  ),
                  Center(child: Text("ユーザー名")),
                  const SizedBox(
                    height: 5,
                  ),
                  RaisedButton(
                    color: Colors.blue,
                    onPressed: (){
                    },
                    child: Column(
                      children: <Widget>[
                        const Icon(MdiIcons.accountHeart, color: Colors.white,),
                        const Text("申請する", style: const TextStyle(color: Colors.white),),
                      ],
                    ),
                  ),
                ],
              ),
            ),
          );
        });
  }

投げ銭はいりません。それより無料でできる拡散をしてください!! 感想をツイートしていただけることが一番嬉しいです!!