I've read the flutter-bloc documentation and I really have no idea what to do anymore. Someone to help?
Asked
Active
Viewed 118 times
2 Answers
0
Probably you didn't import the Bloc package into this file.

Furkan Abbasioğlu
- 208
- 1
- 10
-
-
-
-
try `flutter clean` and `flutter pub get` commands in the terminal – Furkan Abbasioğlu May 18 '22 at 13:51
-
-
-
-
The only way I think is that if you have already added the package to pubspec.yaml, run `flutter pub get` to re-attach it to your project. – Daniel Roldán May 18 '22 at 14:14
-
0
Try create:
instead of bloc:
BlocProvider<UserBloc>(
create: (context) => UserBloc(),
child: Container(),
);

Xuuan Thuc
- 2,340
- 1
- 5
- 22