我想要防止在滑动时丢弃bottom sheet,我想使用Scaffold.of(context).showBottomSheet<void>((BuildContext context) => ...)而不是showModalBottomSheet,因为我需要脚手架信息,showBottomSheet有什么解决方案吗?我该怎么做呢?
发布于 2020-07-16 14:08:02
用GestureDetector包装小部件并禁用拖动:
Scaffold.of(context).showBottomSheet(
  (context) => GestureDetector(
    child: YourWidget(),
    onVerticalDragStart: (_) {},
  ),
)发布于 2021-01-18 07:51:07
如果您正在使用showModalBottomSheet,请使用enableDrag属性。
showModalBottomSheet<bool>(
        context: context,
        enableDrag: false,
        ...
        builder: (BuildContext bc) {
           return ..your widgets...
        }
);发布于 2020-07-16 21:08:21
showModalBottomSheet(
    isDismissible: false,
)https://stackoverflow.com/questions/62936456
复制相似问题