pub.flutter.org 国内镜像站

直接可访问的站点:https://pub.flutter-io.cn

windows设备 系统属性->高级->环境变量:添加下面中的某一对

mac设备

Using Flutter in China

The Flutter community has made a Simplified Chinese version of the Flutter website available athttps://flutter.cn.

If you’d like to install Flutter using an installation bundle, you can replace the domain of the original URL with a trusted mirror to speed it up. For example:

You must also set two environment variables to upgrade Flutter and use the pub package repository in China. Instructions are below.

Important: Use mirror sites only if you trust the provider. The Flutter team cannot verify their reliability or security.

Configuring Flutter to use a mirror site

If you’re installing or using Flutter in China, it may be helpful to use a trustworthy local mirror site that hosts Flutter’s dependencies. To instruct the Flutter tool to use an alternate storage location, you need to set two environment variables, PUB_HOSTED_URL and FLUTTER_STORAGE_BASE_URL, before running the fluttercommand.

Taking MacOS or Linux as an example, here are the first few steps in the setup process for using a mirror site. Run the following in a Bash shell from the directory where you wish to store your local Flutter clone:

content_copy

$ export PUB_HOSTED_URL=https://pub.flutter-io.cn
$ export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
$ git clone -b dev https://github.com/flutter/flutter.git
$ export PATH="$PWD/flutter/bin:$PATH"
$ cd ./flutter
$ flutter doctor

After these steps, you should be able to continue setting up Flutter normally. From here on, packages fetched by flutter pub get are downloaded from flutter-io.cn in any shell where PUB_HOSTED_URL and FLUTTER_STORAGE_BASE_URL are set.

The flutter-io.cn server is a provisional mirror for Flutter dependencies and packages maintained by GDG China. The Flutter team cannot guarantee long-term availability of this service. You’re free to use other mirrors if they become available. If you’re interested in setting up your own mirror in China, contact flutter-dev@googlegroups.com for assistance.

Flutter社区的镜像站
FLUTTER_STORAGE_BASE_URL = https://storage.flutter-io.cn
PUB_HOSTED_URL = https://pub.flutter-io.cn 


上海交通大学 Linux 用户组的镜像站(与原站实时更新)
PUB_HOSTED_URL=https://dart-pub.mirrors.sjtug.sjtu.edu.cn
FLUTTER_STORAGE_BASE_URL=https://mirrors.sjtug.sjtu.edu.cn


清华大学 TUNA 协会的镜像站(与Flutter社区同步)
PUB_HOSTED_URL=https://mirrors.tuna.tsinghua.edu.cn/dart-pub
FLUTTER_STORAGE_BASE_URL=https://mirrors.tuna.tsinghua.edu.cn/flutter


CNNIC的镜像站 (与TUNA同步)
PUB_HOSTED_URL=http://mirrors.cnnic.cn/dart-pub
FLUTTER_STORAGE_BASE_URL=http://mirrors.cnnic.cn/flutter


腾讯开源的镜像站(与TUNA同步)
PUB_HOSTED_URL=https://mirrors.cloud.tencent.com/dart-pub
FLUTTER_STORAGE_BASE_URL=https://mirrors.cloud.tencent.com/flutter

flutter 官网
https://flutter.dev

flutter克隆地址
git clone https://github.com/flutter/flutter.git -b stable

  • 1
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
Explore what Flutter has to offer, where it came from, and where it’s going. Mobile development is progressing at a fast rate and with Flutter – an open-source mobile application development SDK created by Google – you can develop applications for Android and iOS, as well as Google Fuchsia.Learn to create three apps (a personal information manager, a chat system, and a game project) that you can install on your mobile devices and use for real. You will begin by getting a solid foundation of Flutter knowledge, and building on it immediately by constructing two more traditional productivity apps.. You will also learn to create a game, enabling you to see a whole other perspective on what Flutter can do. In addition to building these apps, you'll have the benefit of reviewing real-world issues you might encounter, along with ways to deal with them through tips and tricks, all designed to make your Flutter experience that much more productive and, frankly, fun! Practical Flutter will leave you with a solid grasp of how to build apps with Flutter, and springboard into creating more advanced apps on your own. By the time your journey through this material concludes, another larger one will begin as you springboard, well-prepared, into the larger world of Flutter development, tackling any project that comes your way with aplomb. Practical Flutter is a learning adventure you won't want to miss. What You'll Learn Get a Flutter project started and logically structure it Use the interface elements Flutter provides, such as widgets, controls, and extensions Build layouts using interface elements Use available tooling, specifically Android Studio Leverage server-side development and connect a Flutter app to a server back-end. Who This Book Is For Mobile developers who are looking to build for multiple mobile platforms and trying to do so with a codebase that is largely the same across all. Basic knowledge of iOS and Android generally, and some general programming experience is expected.
### 回答1: 这个错误可能是因为DNS解析出错导致的。可以尝试以下几种解决方法: 1. 检查网络连接是否正常,确保能够正常访问该网。 2. 检查DNS服务器是否可用,如果不可用,可能需要更换DNS服务器。 3. 检查是否在hosts文件中添加了该网的IP地址。 4. 如果以上方法都没有解决问题,可以尝试使用代理服务器进行请求。 5. 如果是在国内使用,可以尝试使用国内镜像,例如 https://pub.flutter-io.cn 如果还是无法解决问题,建议检查下网络环境,或者联系服务器管理员查看是否存在屏蔽. ### 回答2: 在Dart中使用http.head请求页面时,如果报错"Failed host lookup: 'pub.flutter-io.cn'",这通常是因为无法解析目标主机名。这可能是由于以下几个原因引起的: 1. 您的网络连接存在问题,导致无法解析主机名。您可以尝试检查您的网络连接,确保您的网络正常工作。 2. 您的防火墙或安全软件可能阻止了Dart应用程序访问目标主机。您可以尝试禁用防火墙或安全软件,然后再次尝试请求页面。 3. Dart应用程序的DNS配置可能出错,无法正确解析主机名。您可以尝试清除您的DNS缓存或手动配置正确的DNS服务器。 4. 您的hosts文件可能包含了错误的配置,导致无法解析指定的主机名。您可以尝试查看并编辑您的hosts文件,确保没有错误的配置。 5. 您的代码中可能存在错误,导致请求的主机名被错误地设置为'pub.flutter-io.cn'。您可以仔细检查您的代码,确保正确设置了目标主机。 解决这个问题的具体方法可能因具体情况而异,您可以根据上述建议逐一排查,找到导致问题的原因,并采取相应措施来解决。另外,您还可以尝试使用其他网络工具(如curl、浏览器等)来验证请求是否成功,以确定问题的具体原因。

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值