Flutter通过publish_to解决warning: Pu
2023-08-20 本文已影响0人
__Mr_Xie__
警告描述
Publishable packages can't have 'path' dependencies. Try adding a 'publish_to: none' entry to mark the package as not for publishing or remove the path dependency.dart(invalid_dependency)
解决方法
添加代码publish_to: none
,如下:
name: example
description: A new Flutter project.
version: 1.0.0+1
# 下面这行代码防止包被意外发布到
# pub.dev使用pub publish。这是私有包的首选。
#如果你想发布到pub.dev,请删除publish_to: none
publish_to: none
environment:
sdk: ">=2.13.0 <3.0.0"
dependencies:
flutter:
sdk: flutter
flutter_bloc:
path: ../
dependency_overrides:
bloc:
path: ../../bloc
flutter_bloc:
path: ../
flutter:
uses-material-design: true