0

error: A value of type 'BlocProvider' can't be returned from method 'build' because it has a return type of 'Widget'. (return_of_invalid_type at [new_app] lib\src\counter_screen.dart:8)

Using bloc: ^6.1.0 , flutter_bloc: ^6.1.1

[enter image description here] [1]: https://i.stack.imgur.com/bWQ9w.jpg

RaSha
  • 1,356
  • 1
  • 16
  • 30

1 Answers1

0

You are trying to return a type of BlocProvider, but the function Widget build(BuildContext context) must return a Widget. Just simply wrap your BlocProvider with a Container and it should work.