如何将图像放入alertDialog?

我想在用户单击时在警报对话框中显示图像。      我怎样才能做到这一点 ?
GestureDetector(onTap: (){print("girdim");AlertDialog()}
评论
ad_est
ad_est

您可以像这样轻松地使用/构建对话框

await showDialog(
      context: context,
      builder: (BuildContext context) {
        return Dialog(
          elevation: 0,
          shape: RoundedRectangleBorder(
              borderRadius: BorderRadius.all(Radius.circular(12.0))),
          child: Container(
            width: 300,
            height: 300,
            child: Center(
              child: Column(
                mainAxisAlignment: MainAxisAlignment.center,
                mainAxisSize: MainAxisSize.min,
                crossAxisAlignment: CrossAxisAlignment.center,
                children: <Widget>[
                Image.asset('your image')
                ],
              ),
            ),
          ),
        );
      },
    );
点赞
评论