Home > Net >  The named parameter 'bloc' isn't defined - bloc provider
The named parameter 'bloc' isn't defined - bloc provider

Time:05-19

I've read the flutter-bloc documentation and I really have no idea what to do anymore. Someone to help?

error bloc provider

CodePudding user response:

Probably you didn't import the Bloc package into this file.

CodePudding user response:

Try create: instead of bloc:

BlocProvider<UserBloc>(
      create: (context) => UserBloc(),
      child: Container(),
    );
  • Related