xuelongqy / flutter_easy_refresh

A flutter widget that provides pull-down refresh and pull-up load.
https://xuelongqy.github.io/flutter_easy_refresh/
MIT License
3.88k stars 633 forks source link

[功能建议] 在 onRefresh 为 null 时,能否禁止下拉滑动? #672

Closed Junesui closed 1 year ago

Junesui commented 1 year ago

列表在底部dialog 里面,我只想添加下拉加载更多,但是需要禁止下拉刷新 下拉的时候我需要关闭我的底部dialog。

※NotRefreshHeader() 不行,导致下拉时候底部dialog拉不下来

xuelongqy commented 1 year ago

NotRefreshHeader设置maxScrollExtent: 0试试

Junesui commented 1 year ago

还是不行,底部sheet往下拉不动。 刷新组件在这个sheet里写着。


modal_bottom_sheet: ^2.1.2

xuelongqy commented 1 year ago

我设置clamping: true 可以下拉

Junesui commented 1 year ago

感谢回复。但是还是不行。 这是我的代码,BottomSheet 还是拉不下来。

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: MyBtn(
          onPressed: () {
            showModalBottomSheet(
              context: context,
              builder: (context) {
                return SizedBox(
                  height: MediaQuery.of(context).size.height * 0.6,
                  child: EasyRefresh(
                    controller: EasyRefreshController(
                      controlFinishRefresh: true,
                      controlFinishLoad: true,
                    ),
                    header: const NotRefreshHeader(maxOverOffset: 0, clamping: true),
                    child: ListView.builder(
                      itemCount: 30,
                      itemBuilder: (context, index) {
                        return Container(
                          height: 150,
                          color: Colors.primaries[index % 18],
                        );
                      },
                    ),
                  ),
                );
              },
            );
          },
          child: const FlutterLogo(size: 100),
        ),
      ),
    );
  }
xuelongqy commented 1 year ago

modal_bottom_sheet这个可以,自带的showModalBottomSheet本身就不支持吧?

Junesui commented 1 year ago

感谢,确实是的。解决了。 refresh 也用了最新版。

ps:旧版本下面这个报错问题找了很久没找到,还以为是布局问题。 fix: NestedScrollView resize error