我有一个 ListView 和一个 DraggableScrollableSheet,它们可以在 Stack 小部件中重叠。是否有可能只有一个 GestureDetector 总是在最上面?

时间:2021-03-18 15:54:23

标签: flutter flutter-layout

我有一个 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),
       }
   ),
])

0 个答案:

没有答案
相关问题