Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MaterialHeader 会在顶部出现 #575

Closed
fdh19979 opened this issue Jul 26, 2022 · 6 comments
Closed

MaterialHeader 会在顶部出现 #575

fdh19979 opened this issue Jul 26, 2022 · 6 comments

Comments

@fdh19979
Copy link

fdh19979 commented Jul 26, 2022

MaterialHeader 会在顶部出现

写法如下


  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          height: 100,
          color: Colors.grey,
        ),
        Expanded(
          child: EasyRefresh(
            header: MaterialHeader(clamping: false),
            controller: controller,
            onRefresh: () {
              Future.delayed(Duration(seconds: 1)).then((value) => controller.finishRefresh());
            },
            child: ListView.builder(
              itemCount: 200,
              itemExtent: 50,
              itemBuilder: (context, index) => Container(
                color: Colors.green,
                width: 50,
                child: Text(index.toString()),
              ),
            ),
          ),
        ),
      ],
    );
  }

@xuelongqy
Copy link
Owner

设计如此。可以试试在线示例,了解各个参数的作用

@xyhuangjia
Copy link

我也出现这个问题了 @fdh19979 ,大佬有方案解决么?

@xuelongqy xuelongqy reopened this Jul 27, 2022
@xuelongqy
Copy link
Owner

设计如此。可以试试在线示例,了解各个参数的作用

的确有这个问题,看起来像是布局没有被遮挡

@xuelongqy
Copy link
Owner

xuelongqy commented Jul 27, 2022

临时解决办法,使用Container加上抗锯齿

  @override
  Widget build(BuildContext context) {
    return Column(
      children: [
        Container(
          height: 100,
          color: Colors.grey,
        ),
        Expanded(
          child: Container(
            decoration: BoxDecoration(),
            clipBehavior: Clip.antiAlias,
            child: EasyRefresh(
              header: MaterialHeader(clamping: true),
              controller: _controller,
              onRefresh: () {
                Future.delayed(Duration(seconds: 1)).then((value) => _controller.finishRefresh());
              },
              child: ListView.builder(
                itemCount: 200,
                itemExtent: 50,
                itemBuilder: (context, index) => Container(
                  color: Colors.green,
                  width: 50,
                  child: Text(index.toString()),
                ),
              ),
            ),
          ),
        ),
      ],
    );
  }

@fdh19979
Copy link
Author

fdh19979 commented Jul 31, 2022

@xyhuangjia xyhuangjia没有解决方案,你可以试试下面作者提出的加上抗锯齿

@xuelongqy
Copy link
Owner

v3.0.3已发布,可以根据不同的需求设置clipBehavior

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants