flutter BlocProvider context that does not contain a Cubit of type #### 错误

BlocProvider.of() called with a context that does not contain a Cubit of type ####.
从字面翻译 可以看到 Cubit 没有context 上下文调用BlocProvider.of()

官方解决

flutter BlocProvider context that does not contain a Cubit of type #### 错误
flutter BlocProvider context that does not contain a Cubit of type #### 错误

flutter BlocProvider context that does not contain a Cubit of type #### 错误

flutter BlocProvider context that does not contain a Cubit of type #### 错误
之后看文档发现少了个返回值。加个return 就好了flutter BlocProvider context that does not contain a Cubit of type #### 错误
如果还是不行的话,可以尝试在子类的外面在套个Builder
flutter BlocProvider context that does not contain a Cubit of type #### 错误
这样的话就能获取到了。
flutter BlocProvider context that does not contain a Cubit of type #### 错误