mrapi
mrapi

Reputation: 6015

The type 'ChangeNotifierProxyProvider' is declared with 2 type parameters, but 3 type arguments were given

I use a provider inside of another provider using that declaration

 ChangeNotifierProxyProvider<Auth, Sali>(
            update: (ctx, auth, prevData) => Sali(
                auth.token, auth.userId, prevData == null ? [] : prevData.sali),
          ),

but I need to use 2 providers inside another so I tried:

ChangeNotifierProxyProvider<Auth,Mese, Sali>(
            update: (ctx, auth,mes, prevData) => Sali(
                auth.token, auth.userId, prevData == null ? [] : prevData.sali),

but got this error:

"The type 'ChangeNotifierProxyProvider' is declared with 2 type parameters, but 3 type arguments were given.

thanks

Upvotes: 4

Views: 630

Answers (1)

Pro
Pro

Reputation: 3003

mrapi, I haven't used ChangeNotifierProxyProvider but have you tried ChangeNotifierProxyProvider2. Looking at the documentation, i think it takes 3 parameters.

Upvotes: 4

Related Questions