Skip to content

The named parameter 'bloc' isn't defined in main.dart #3

Description

@MirceaTheOldMan

Hi. I get this error using your code, but with a newer version of the flutter_bloc: ^0.21.0
I downgraded to 0.11.0 and it doesn't return the same error.

Update:
I just realized that this is just a proof of concept, but if you want to update the code to the current version of the flutter_bloc, you might want to change _MyHomePageState class to this:
class _MyHomePageState extends State<MyHomePage> { @override Widget build(BuildContext context) { return BlocProvider<CounterBloc>( builder: (context) => CounterBloc(), child: CounterWidget(widget: widget), ); } // BlocProvider also handles disposing the CounterBloc automatically }

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions