aagarwal1012 / Liquid-Pull-To-Refresh

🔁 A custom refresh indicator for flutter.
https://pub.dev/packages/liquid_pull_to_refresh
MIT License
1.25k stars 91 forks source link

"New Posts" like in facebook app #36

Closed Nisthar closed 4 years ago

Nisthar commented 4 years ago

Is your feature request related to a problem? Please describe. Pulling every time for updates is tiresome.

Describe the solution you'd like Instead of pulling the list for updates each time, show a rounded banner on top saying "New posts available" when the user clicks on it, the list refreshes. I think this will be easy to implement into the library. It would be better user experience.

AadumKhor commented 4 years ago

@Nisthar Thanks for the suggestion. However, this use case is very specific since having a button on top of your widgets at all times can also be annoying. And we have no way to know if there are 'new posts' since we do not deal with the APIs directly through the package. However this functionality can be added from your end in the following way :

  1. Make your list a child to the LiquidPullToRefresh
  2. Check with your API if there are new updates.
  3. If any, display a button on top of your widget tree using a Stack and on clicking the button make use of the Key you've made for theLiquidPullToRefresh Widget to initiate the refresh as shown in the example ( Retry button in the SnackBar )

This would allow you to use the package as stated in the suggestion.

If there is something you want to add to this please feel free to. Keeping this issue open for some time.