I am in the process of programming my app and need to use a ChangeNotifierProxyProvider. Unfortunately my ChangeNotifier (in this case Entries) needs 3 positional arguments. I already managed to specify the arguments in update, but how can I do it in create?
I would be very happy about an answer, because I can't find anything on the internet.
Hey! I am in the process of programming my app and need to use a ChangeNotifierProxyProvider. Unfortunately my ChangeNotifier (in this case Entries) needs 3 positional arguments. I already managed to specify the arguments in update, but how can I do it in create?
I would be very happy about an answer, because I can't find anything on the internet.
Here is my code for the providers: []:
providers: [
ChangeNotifierProvider.value(value: Auth()),
ChangeNotifierProxyProvider<Auth, Entries>(
create: (_) => Entries(),
update: (_, auth, previousEntries) => Entries(
auth.token,
auth.userId,
previousEntries == null ? [] : previousEntries.items,
),
),
],