-
-
Notifications
You must be signed in to change notification settings - Fork 523
Open
Labels
enhancementNew feature or requestNew feature or request
Description
Discussed in #873
Originally posted by taosimple April 19, 2024
ProxyProvider0<TransformedCounter>(
update: (context, value) {
final value = context.select<Counter, int>((counter) => counter.value);
return TransformedCounter(value * 2);
},
),
ProxyProvider0<TransformedCounter>(
update: (context, value) {
final counter = context.watch<Counter>();
return TransformedCounter(counter.value * 2);
},
),
Above codes use context.select
will throw a exception: Tried to use context.select
outside of the build
method of a widget., but use context.watch
is fine, why context.select
is not allowed, it more efficient than context.watch
.
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or request