'Problem with update multiprovider flutter

I recently updated some dependencies of my flutter application and I had this problem with the multiprovider, could someone guide me on how is the new syntax or what is the problem here?

the previous provider dependency I was working with was ^ 3.0.0 + 1, now it is at 5.0.0

enter image description here



Solution 1:[1]

Never post images of your code, we can't copy from it or reproduce it. Here's a setup of some multiproviders in a project I have:

 Widget build(BuildContext context) {
    return MultiProvider(
      providers: [
        ChangeNotifierProvider<UserState>(create: (ctx) => UserState()),
        ChangeNotifierProvider<Cart>(create: (ctx) => Cart()),
        ChangeNotifierProvider<LocationProvider>(create: (ctx) => LocationProvider()),
      ],
      child: MaterialApp(theme: ThemeData(
      primarySwatch: Colors.blue,
      ),home: Consumer<UserState>(builder: (context, userState, __) {
      if (userState.firstRun) {
        userState.getLastUser();
      }

      return userState.isSignedin ? CustomDrawer(appUser: userState.user) : LoginPageScreen();
    }),
  ),   
 );      
}       

There are changes between provider ^3 and ^5, the documentation is pretty decent and does a good job explaining things. The code I posted is using provider: ^5.0.0.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Huthaifa Muayyad