Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
MirceaTheOldMan opened this issue Sep 19, 2019 · 0 comments
Open

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

MirceaTheOldMan opened this issue Sep 19, 2019 · 0 comments

Comments

@MirceaTheOldMan
Copy link

MirceaTheOldMan commented Sep 19, 2019

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 }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant