You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
What's the complexity of dispatching notifications to all consumers - in other words all Widgets calling Provider.of<T>, of a Provider<T> ?
So for example let's say we have one StreamProvider of String and N consumers of the String below it. What's then the complexity of dispatching updates to all consumers when there is a new value in a Stream?
classHomePageextendsStatelessWidget {
@overrideWidgetbuild(BuildContext context) {
returnStreamProvider<String>.value(
value: someStream,
child:Column( // There is in total N consumers of String in the subtree of this Column
children: [
Consumer<String>(...),
Consumer<String>(...),
Row(
children: [
Consumer<String>(...),
Selector<String, bool>(...),
],
),
...,
...,
...,
ProxyProvider<String, int>(...),
Selector<String, bool>(...),
],
),
);
}
}
For comparison ChangeNotifier has a O(N²) complexity for this and I was curious what it is in case of Provider
The text was updated successfully, but these errors were encountered:
So, is it best and simplier to have only one Provider for the whole app (instead of many for different features...) and only using Selector (instead of many Consumer or Provider.of) ?
What's the complexity of dispatching notifications to all consumers - in other words all Widgets calling
Provider.of<T>
, of aProvider<T>
?So for example let's say we have one StreamProvider of String and N consumers of the String below it. What's then the complexity of dispatching updates to all consumers when there is a new value in a Stream?
For comparison ChangeNotifier has a O(N²) complexity for this and I was curious what it is in case of Provider
The text was updated successfully, but these errors were encountered: