Since builder method of ChangeNotifierProxyProvider in flutter is deprecated i'm tring to implement create and update new methods of provider 4.
I need the main Auth Provider called User Provider inside another Provider(ContoProvider) on create but I have runtime error with Provider not found. All this provider are inside a Multiprovider in the main.dart file so the at the top of widget chain.
Probably this isn't the right method to pass the provider but i need in the create because i use it immediately
return MultiProvider(
providers: [
ChangeNotifierProvider<UserProvider>(
create: (_) => UserProvider.init(),
),
ChangeNotifierProxyProvider<UserProvider, ContoProvider>(
create: (_) => ContoProvider.init(
Provider.of<UserProvider>(context, listen: false),
),
update: (_, userProvider, contoProvider) =>
contoProvider..update(userProvider),
),
],child:..