URI的目标不存在:flutter_bloc/flutter_bloc.dart'。 Android Studio
我创建了一个全新的扑动项目,我添加了 Bloc: ^8.0.3
和equatable: ^2.0.3
pubspec。 yaml
文件,我刚导入导入'软件包:flutter_bloc/flutter_bloc.dart';
在主文件中,它给了我上述错误uri的目标不存在:'软件包:flutter_bloc/flutter_bloc.dart'。
我添加了一个cubit文件和导入的导入'package'package'package:bloc/bloc.dart';
,导入后没有问题,我可以总结'软件包:bloc'
和'Flutter'
存在,但是'Flutter_bloc'
不存在,也不知道为什么,即使我也不存在尝试了许多解决方案,例如删除pubspec.lock
和.packages
并运行命令flutter pub get
code> include> include inclage:package:package:package:package:package: flutter_lints/flutter.yaml ,但问题未解决
I created a brand new flutter project, I added bloc: ^8.0.3
and equatable: ^2.0.3
to pubspec.yaml
file, I just imported import 'package:flutter_bloc/flutter_bloc.dart';
in the main file, and it gives me the above error Target of URI doesn't exist: 'package:flutter_bloc/flutter_bloc.dart'.
I added a cubit file and imported import 'package:bloc/bloc.dart';
and no problem happened after importing, I can summarize that 'package:bloc'
and 'flutter'
exist, but the 'flutter_bloc'
not exist, and don't know why, even I tried a lot of solutions like deleting pubspec.lock
and .packages
and run command flutter pub get
, and disable include: package:flutter_lints/flutter.yaml
, but the problem not solved
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您还应该添加 flutter_bloc package to pubspec.yaml文件,该文件使其易于使用blocs and cubits。
然后运行
flutter Pub获取
以获取软件包。You should also add flutter_bloc package to the pubspec.yaml file which makes it easy to use blocs and cubits.
and then run
flutter pub get
to get the package.