繁体   English   中英

: 错误: 没有为 class 'BlocBase 定义 getter 'ut'<state> '</state>

[英]: Error: The getter 'ut' isn't defined for the class 'BlocBase<State>'

我正在关注这个例子https://github.com/felangel/bloc/tree/master/examples/flutter_firebase_login

具有以下依赖项

  cupertino_icons: ^1.0.5
  equatable: ^2.0.5
  flow_builder: ^0.0.9
  flutter:
    sdk: flutter
  flutter_bloc: ^8.1.1
  flutterfire_ui: ^0.4.3+10
  font_awesome_flutter: ^10.2.1
  form_inputs:
    path: ../packages/form_inputs
  formz: ^0.4.1
  google_fonts: ^3.0.1
  meta: ^1.8.0

然后我正在运行应用程序它返回以下错误

Launching lib/main.dart on sdk gphone64 x86 64 in debug mode...
: Error: 'rethrow' can't be used as an identifier because it's a keyword.
../…/src/bloc_base.dart:105
Try renaming this to be an identifier that isn't a keyword.
      ut.rethrow;
         ^^^^^^^
: Error: The getter 'ut' isn't defined for the class 'BlocBase<State>'.
../…/src/bloc_base.dart:105
- 'BlocBase' is from 'package:bloc/src/bloc.dart' ('../../../../snap/flutter/common/flutter/.pub-cache/hosted/pub.dartlang.org/bloc-8.1.0/lib/src/bloc.dart').
package:bloc/src/bloc.dart:1
Try correcting the name to the name of an existing getter, or defining a getter or field named 'ut'.
      ut.rethrow;
      ^^
2

FAILURE: Build failed with an exception.

我也试过

flutter_bloc: ^ 8.1.0 和 8.0.1 也返回同样的问题

任何人都有同样的问题,如果是这样,你的建议是什么?

此问题通过以下方式解决

flutter pub cache repair

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM