aagarwal1012 / Liquid-Pull-To-Refresh

🔁 A custom refresh indicator for flutter.

Home Page:https://pub.dev/packages/liquid_pull_to_refresh

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Refresh indicator overlays on list view

limpep opened this issue · comments

commented

Describe the bug
Hi, when you pull to refresh and the refresh indicator is overlayed on top of the list rather than pushing the list view down as shown in the screencasts on the readme.

To Reproduce
Steps to reproduce the behavior:

  1. running latest table version of flutter and dart

Expected behavior
The refresh indicator should push the list view down.

Screenshots

Flutter:

    • Flutter version 1.12.13+hotfix.9 at C:\tools\flutter
    • Framework revision f139b11009 (4 weeks ago), 2020-03-30 13:57:30 -0700
    • Engine revision af51afceb8

Dart:
• Dart version 2.7.2

Additional context
sdk: ">=2.7.0 <3.0.0"
liquid_pull_to_refresh: ^1.2.0

@override
  Widget build(BuildContext context) {
    final formatter = LastUpdatedDateFormatter(
        lastUpdated: _endpointsData != null
            ? _endpointsData.values[EndPoint.cases]?.date ?? DateTime.now()
            : null);
    return Scaffold(
      appBar: AppBar(
        title: Text("Covid19 Tracker"),
        actions: [
          IconButton(
            icon: Icon(Icons.settings),
            onPressed: () {
              //Navigate to Settings screen
              Navigator.push(
                context,
                MaterialPageRoute(
                  builder: (context) => Settings(),
                ),
              );
            },
          )
        ],
      ),
      body: LiquidPullToRefresh(
        onRefresh: _updateData,
        showChildOpacityTransition: false,
        springAnimationDurationInMilliseconds: 600,
        backgroundColor: Theme.of(context).canvasColor,
        child: ListView(
          children: <Widget>[
            LastUpdatedStatus(
              text: formatter.lastUpdatedStatusText(),
            ),
            for (var endpoint in EndPoint.values)
              EndPointCard(
                endpoint: endpoint,
                value: _endpointsData != null
                    ? _endpointsData.values[endpoint]?.value
                    : null,
              ),
          ],
        ),
      ),
    );
  }

Thank you for pointing this out. The latest commit fdf49fd solves the above issue.

@aagarwal1012 Please check as it shows an error on while passing the build.

@AadumKhor, Travis shows a successful build but codecov shows that it degrades code coverage which we can deal later on. Your commit looks fine to proceed towards creating a Pull Request for the issue.

@aagarwal1012 I have made the changes directly to the master branch.

@AadumKhor, I will not suggest to directly push to master rather try to create a PR next time.

@aagarwal1012 Ok. Will do in case of further issues.

commented

So I am guessing a new release needs to be created to be able to tests this?

Yes, I will do the release by today.

commented

Great, look forward to trying the new version. Thanks.

Closing this since the issue is resolved.

commented

interesting, maybe I have missed the release....

Any news on new version with this fix :) ?

@dukaric1991 @limpep I have published a new version of this package, v2.0.0. Have a look at it and please tell us if you have any suggestions.

commented

@aagarwal1012 I can confirm that it is working now. Thanks, much appreciated.

@aagarwal1012 i can also confirm that it works as expected! thanks!

commented

I've upgrade from version 1.1.1 to 2.0.0 and now I'm encountering the same problem as mentioned in the original post here.
Do I have to do something special to have the ListView.builder() pushed down by the refresh?