URI的目标不存在:flutter_bloc/flutter_bloc.dart'。 Android Studio

发布于 2025-02-06 18:59:30 字数 677 浏览 2 评论 0原文

我创建了一个全新的扑动项目,我添加了 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 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

笑红尘 2025-02-13 18:59:32

您还应该添加 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.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文