The current provider only instantiates when used. but there are a few cases where I want it to be initialized before use, like lazy: false.
Mhhh but you can basically do
``dart
runApp(ProviderScope(child:
HookBuilder(builder: (context) {
useProvider(provider);
return MyApp();
}))));
Consumer version:
runApp(
ProviderScope(
child: Consumer(
(context, watch) {
watch(provider);
return MyApp();
},
),
),
);
The lazy parameter is simple impossible to implement for numerous technical reasons.
So the approach mentioned by @smiLLe and @mono0926 is the best
Yep. 馃槄
Most helpful comment
The lazy parameter is simple impossible to implement for numerous technical reasons.
So the approach mentioned by @smiLLe and @mono0926 is the best