将提供程序包添加到Flutter Web项目时出错 [英] Error when adding provider package to flutter web project

查看:99
本文介绍了将提供程序包添加到Flutter Web项目时出错的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我试图将提供程序包添加到我的flutter网站项目中,并收到以下错误:

I tried to add the provider package to my flutter web project and got the following error:


因为每个版本的提供程序都取决于从sdk中扑灭任何>禁止的,提供者被禁止。
因此,因为WebApplication依赖于提供程序^ 3.0.0,所以版本解析>失败。

Because every version of provider depends on flutter any from sdk which is >forbidden, provider is forbidden. So, because WebApplication depends on provider ^3.0.0, version solving >failed.

Flutter用户应运行 flutter软件包get 而不是 pub get
流程结束,退出代码为69

Flutter users should run flutter packages get instead of pub get. Process finished with exit code 69

我尝试了 flutter软件包获得,并将flutter升级到最新版本。
当运行 flutter软件包获取时,不会显示错误,但是当我尝试 webdev服务时,以下错误是显示:

I tried flutter packages get and also upgraded flutter to the newest version. When running flutter packages get the error is not shown but when i tried webdev serve the following error is shown:


webdev无法为此项目运行。
在> C:\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\provider-3.0.0中找不到名为 pubspec.yaml的文件。

webdev could not run for this project. Could not find a file named "pubspec.yaml" in >"C:\AppData\Roaming\Pub\Cache\hosted\pub.dartlang.org\provider-3.0.0".

我也看了广告 https://github.com/flutter/flutter/issues/21338 但没有解决我的错误。

also i looked ad https://github.com/flutter/flutter/issues/21338 but didn't solve my error.

我正在使用Flutter(频道beta,v1.6.3,在Microsoft Windows [版本10.0.17134.765],区域设置为DE-DE)

Im using Flutter (Channel beta, v1.6.3, on Microsoft Windows [Version 10.0.17134.765], locale de-DE)

environment:
  sdk: '>=2.3.0-dev.0.1 <3.0.0'

dependencies:
  flutter_web: any
  flutter_web_ui: any
  provider: ^3.0.0

dev_dependencies:
  build_runner: ^1.4.0
  build_web_compilers: ^2.0.0
  pedantic: ^1.0.0


推荐答案

您的问题已在此处得到回答: https://github.com/rrousselGit/provider/issues/82

Your question is already answered here: https://github.com/rrousselGit/provider/issues/82

使用kevmoo的 https://github.com/kevmoo/provider的 flutter_web 分支 povider叉为:

Use flutter_web branch of kevmoo's https://github.com/kevmoo/provider povider fork as:

dependencies:
  flutter_web: any
  flutter_web_ui: any
  provider: any

dependency_overrides:
  flutter_web:
    git:
      url: https://github.com/flutter/flutter_web
      path: packages/flutter_web
  flutter_web_ui:
    git:
      url: https://github.com/flutter/flutter_web
      path: packages/flutter_web_ui
  provider:
    git:
      url: https://github.com/kevmoo/provider
      ref: flutter_web

这篇关于将提供程序包添加到Flutter Web项目时出错的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆