-
Notifications
You must be signed in to change notification settings - Fork 215
Using flutter redux and Refresh Indicator #6
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
Comments
Ah, that's an interesting one. Thanks for writing in i'm on vacation for a few days, but I'll take a look at this and bit more carefully when I'm back in action early next week to see if I can make something easy to use :) |
That's great, thanks @brianegan . Enjoy your vacation! |
Hey hey, sorry about the delay! Came back to quite a bit of work :) Here's the best solution I could think of:
Example here: https://github.com/brianegan/flutter_redux/blob/refresh-indicator-example/example/lib/main.dart#L10 I'll try to think if there's a good way to make this easier in some way... Maybe a generic action or middleware. |
Brian, |
Brian, Since the move to Dart2, I don't seem to be able to use a Completer in the middleware. Is there a way around this or a better way to manager the refresh indicator now? Thanks |
Heya @oli107. Hrm, that's interesting -- I haven't run into that problem with Dart 2 + Completers. Is the Completer just not working, or are you running into type errors of some kind? |
I'm profusely apologetic @brianegan - I think that was a case of me working on this too late at night! Typo on my part caused a type error, but it is fixed and working. I'll re-close the issue. Next challenge - work out how to animate things whilst using redux... |
Hah, no worries at all :) We've all been there! |
Hi there, |
Heya @tanphathuynh -- yep, that's a standard type error, which Dart 2 is now more strict about. In this case, the |
This resolves issue brianegan#12 and provides a built-in workaround for brianegan/flutter_redux#6.5
Hey, thanks for the awesome work and continuous support. For this issue, can we wrap every object in the state inside another object which contains the information about the status, the actual data (Generic) and a message. Something like this:
Making three plausible condition as follows:
|
…top early"" This reverts commit 3cc01f64 because apparently this is the correct way to do it, as sneaky as it seems. See brianegan/flutter_redux#6 (comment)
With some effort, I have successfully managed to smuggle a new class called SpecializedCompleterTuple through some actions such that the middleware can have some influence on a UI widget which originally constructed (and is listening to the futures inside of) the SpecializedCompleterTuple. My purposes for doing this are outlined in the documentation of SpecializedCompleterTuple. I'm justifying how jank this system is because it's not far off from what Brian Egan recommended (brianegan/flutter_redux#6 (comment)). However, I do hope I find something cleaner than this for the future. This also relates to Workiva/built_redux#103 and flutter/flutter#11675.
I've released a new package called declarative_refresh_indicator which takes a boolean |
Hi,
Great library, I've really enjoyed implementing it but I've had a bit of a mammoth session and can't seem to wrap my head around this one. I am pretty new to Flutter and Dart so apologies if this is a simple question.
I want to use a pull to refresh which sends an action and retrieves a new set of items from the web via the middleware. Doing this without the refresh indicator works well, but the indicator needs a Future passed to it that resolves when the action has finished. Is there any way that I can use the existing stock widget to start and stop based on actions?
Thanks
The text was updated successfully, but these errors were encountered: