小编Ali*_*bas的帖子

Flutter:通过滑动关闭对话框

我已经使用对话框创建了这个图像查看器,我需要实现滑动以存在(向上或向下拖动)来执行Navigator.of(context).pop()

这是我需要在其中实现滑动的代码。

showGeneralDialog(
  context: context,
  barrierColor: Colors.grey.shade900
      .withOpacity(0.95), // Background color
  barrierDismissible: false,
  barrierLabel: 'Dialog',
  transitionDuration: Duration(
      milliseconds:
          400), 
  pageBuilder: (_, __, ___) {
    // Makes widget fullscreen
    return SafeArea(
      child: SizedBox.expand(
        child: Column(
          children: <Widget>[
          
          ],
        ),
      ),
    );
  },
);
Run Code Online (Sandbox Code Playgroud)

在此输入图像描述

dart flutter

2
推荐指数
1
解决办法
1927
查看次数

标签 统计

dart ×1

flutter ×1