GithubHelp home page GithubHelp logo

Comments (12)

AndreiMisiukevich avatar AndreiMisiukevich commented on May 29, 2024 3

Hey folks, what was the reason it's disabled in flutter 3?

from flutter-custom-refresh-indicator.

gustavomaedo avatar gustavomaedo commented on May 29, 2024 2

It is no longer working in Flutter 3

from flutter-custom-refresh-indicator.

gustavomaedo avatar gustavomaedo commented on May 29, 2024 1

This commit is the problem! (Feb 18, 2022)
"Show RefreshIndicator on top when scroll's axis direction is up (matching native behaviour) (#93779)"
flutter/flutter@14a406f

I'm using the code from the previous commit (Jan 28, 2022):
flutter/flutter@120d25f?diff=unified

from flutter-custom-refresh-indicator.

aednlaxer avatar aednlaxer commented on May 29, 2024 1

I haven't tested this yet but it sounds fantastic! Thanks @gonuit! πŸŽ‰

from flutter-custom-refresh-indicator.

gonuit avatar gonuit commented on May 29, 2024

Hi @aednlaxer,
It is possible to enable the bottom pull to refresh indicator. All you need to do is set the reverse argument on your scrollable widget like for example: ListView to true. Let me know if this is what you were looking for.


example

from flutter-custom-refresh-indicator.

aednlaxer avatar aednlaxer commented on May 29, 2024

I didn't know about the reverse argument, thanks. Although I'm looking for a bit different thing here. I have a ListView and I'd like to perform two different actions (and have two different indicators) when pulling down from the top and when pulling up from the bottom. Does library support this kind of behavior?

from flutter-custom-refresh-indicator.

kavienanj avatar kavienanj commented on May 29, 2024

So you basically preparing to implement the lazy loading list view right?

from flutter-custom-refresh-indicator.

gonuit avatar gonuit commented on May 29, 2024

Hi @aednlaxer πŸ‘‹πŸ» ,
I close this issue as there is no more information. Feel free to reopen it if there is still a need for some action.

from flutter-custom-refresh-indicator.

gonuit avatar gonuit commented on May 29, 2024

I'm on it πŸ•΅πŸ»

from flutter-custom-refresh-indicator.

gonuit avatar gonuit commented on May 29, 2024

Hi @gustavomaedo,
What is the exact issue you are getting? I tested it on the latest version of Flutter (3.3.2) and it works fine for me. πŸ€”
Maybe you are able to provide me a GIF/video, stack trace, or just give me more details about it πŸ‘€

from flutter-custom-refresh-indicator.

gonuit avatar gonuit commented on May 29, 2024

Oh, I see that this is not recognized correctly for the built-in RefreshIndicator widget, but the CustomRefreshIndicator widget provided by this package, still works. Is that correct?
If so, this issue is not related to this package code.

from flutter-custom-refresh-indicator.

gonuit avatar gonuit commented on May 29, 2024

Ok, there is an update from my side πŸ₯³

I am working on version 2.0.0, and a lot of things still need to be done before a stable release BUT! The release 2.0.0-dev.1 is already available on the pub.dev.

It will bring many small fixes and improvements.
The feature you asked for @aednlaxer is now implemented. From version 2.0.0, you will be able to select the bottom, top, or even both edges that will trigger the pull to refresh mechanism.

CustomRefreshIndicator(
  edge: IndicatorTriggerEdge.bothEdges, // that will do the trick. Defaults to IndicatorTriggerEdge.start
  onRefresh: onRefresh, 
  builder: customIndicatorBuilder,
  child: ListView(children: [/***/]),
);

In addition, from the controller, you will be able to read which edge triggered the pull to refresh action

if (controller.edge == IndicatorEdge.leading) {
  print("action triggered from the start of the list");
} else if(controller.edge == IndicatorEdge.trailing) {
  print("action triggered from the end of the list");
}

and even on which side of the list the indicator should appear. It takes scroll direction (reversed lists), axis (horizontal/vertical) and edge (especially useful when the edge argument is set to IndicatorTriggerEdge.both, as the action can then be triggered from both edges).

if (controller.side == IndicatorSide.top) { // for vertical lists
  print("Display the indicator widget at the top of the list");
} else if (controller.side == IndicatorSide.bottom) { // for vertical lists
  print("Display the indicator widget at the bottom of the list");
} else if (controller.side == IndicatorSide.left) { // for horizontal lists
  print("Display the indicator widget on the left side of the list");
} else if (controller.side == IndicatorSide.right) { // for horizontal lists
  print("Display the indicator widget on the right side of the list");
}

It is also worth noting that, unlike the built-in RefreshIndicator widget, this package supports horizontal lists and a reverse list parameter.


This API is still in WIP status so it may change, but you can already taste it if you want.

from flutter-custom-refresh-indicator.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.