marcglasberg / provider_for_redux Goto Github PK
View Code? Open in Web Editor NEWFlutter Package: Let's you use Provider with Redux.
License: BSD 2-Clause "Simplified" License
Flutter Package: Let's you use Provider with Redux.
License: BSD 2-Clause "Simplified" License
Hi could you to push the latest version into the 'Pub' please :-) ?
Provider 4.0.0 was released recently.
Consider updating this library to support the new provider version.
Please upgrade to the latest async_redux version
Could you upgrade to the latest async_redux ^15.0.0
I like your approach and considering replacing the 'plain vanilla' Redux that I am currently using with your async_redux. I have a fairly complex domain model however that gets assembled by using reselect library selectors. I was wondering if there is a way to achieve the same behaviour (caching and reusing already cached data) with the ReduxSelector?
I know that I could still use the reselect after moving to the async_redux but It would be great to have this provided by the ReduxSelector so I could drop all the ViewModels that are required by the flutter_redux StoreConnector.
Following is error while using ReduxSelector
Error: Could not find the correct Provider<(ReduxAction, {bool notify}) => void> above this ReduxSelector<AppState, dynamic> Widget
This happens because you used a BuildContext
that does not include the provider
of your choice. There are a few common scenarios:
You added a new provider in your main.dart
and performed a hot-reload.
To fix, perform a hot-restart.
The provider you are trying to read is in a different route.
Providers are "scoped". So if you insert of provider inside a route, then
other routes will not be able to access that provider.
You used a BuildContext
that is an ancestor of the provider you are trying to read.
Make sure that ReduxSelector<AppState, dynamic> is under your MultiProvider/Provider<(ReduxAction, {bool notify}) => void>.
This usually happens when you are creating a provider and trying to read it immediately.
For example, instead of:
Widget build(BuildContext context) {
return Provider<Example>(
create: (_) => Example(),
// Will throw a ProviderNotFoundError, because `context` is associated
// to the widget that is the parent of `Provider<Example>`
child: Text(context.watch<Example>()),
),
}
consider using builder
like so:
Widget build(BuildContext context) {
return Provider<Example>(
create: (_) => Example(),
// we use `builder` to obtain a new `BuildContext` that has access to the provider
builder: (context) {
// No longer throws
return Text(context.watch<Example>()),
}
),
}
Would you be able to to push the latest version to the 'Pub' please?
Could you also set the 'async_redux' dependency to the latest version if that works?
Many thanks
Adam
Per the changelog for provider 4.1.0, new extensions have been added to BuildContext to reduce verbosity of the provider calls when used to fetch objects. I suspect adding this may be as straightforward as updating the provider dependency.
Please upgrade to the latest async_redux version.
Many thanks
A declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.