超的博客
文章 标签 我
搜索结果

弹框组件示例

2025-04-18

弹框

_showAlertDialog(String msg) {
showDialog<bool>(
    context: context,
    builder: (BuildContext context) {
    return AlertDialog(
        title: Text("提示"),
        content: Text(msg),
        actions: [
        TextButton(
            onPressed: () {
            // 关闭弹框
            Navigator.of(context).pop(true);
            },
            child: Text("确定"),
        ),
        ],
    );
    },
);
return null;
}

联系方式: dccmmtop@foxmail.com

  • flutter
<  通知android设备刷新媒体库
网格组件 >
© 2025 dc
Powered by Hugo with theme Minos