flutter - 我有一个 ListView 和一个 DraggableScrollableSheet,它们可以在 Stack 小部件中重叠。是否有可能只有一个 GestureDetector 始终位于顶部?
问题描述
我有一个 ListView() 和一个 DraggableScrollableSheet(),它们可以在 Stack() 小部件中重叠。我可以说 DraggableScrollableSheet GestureDetector 总是在最前面吗?
现在 PageView 的 _pageController 位于 _scrollableSheetController 之上
Stack(
alignment: Alignment.topCenter,
children: [
Column(
children: [
SizedBox(
height: 20,
),
BreadCrumbIndicators(pageController: _pageController),
PageView(...),
],
),
NotificationListener<DraggableScrollableNotification>(
onNotification: (notification) {
print("bottom sheet postion : ${notification.extent}");
setState(() {
_bottomSheetPosition = notification.extent;
});
return true;
},
child: DraggableScrollableSheet(
expand: true,
initialChildSize: 0.3,
minChildSize: 0.12,
maxChildSize: 0.5),
}
),
])
解决方案
推荐阅读
- android - 约束中的 android:visibility 和 PropertySet android:visibility 有什么区别
- python - Python - 寻找一种方法来提高效率
- vue.js - 本地存储输入字段显示未定义值
- c# - ASP.Net Core 如何使用 ISO-8859-1 字符集解析 XML 请求
- c# - WPF ItemsControl 无法绑定命令
- python - 如何为 pandas df 正确编写 if-then lambda 语句?
- java - 就空间效率而言,使对象列表不可变的最佳方法是什么?
- python - 如何在 500MiB 的免费 slug 大小内在 Heroku 中部署 tensorflow 模型?
- javascript - 如何检测页面上需要的字体并加载必要的字体
- python - 在 Tensorflow 2.x 中访问和微调 Tensorflow 1.x 模型(架构和变量)