-
Notifications
You must be signed in to change notification settings - Fork 3.5k
Update using Flutter from China #9338
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7d6f5aa
d169ecc
93999f4
e9270d9
199cb48
2ba94c6
7e7f336
250fd6f
70f0c48
078b5cd
551f432
f63b25f
c1967d7
a1d58e8
e7491d2
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,22 @@ | ||
| - group: 'China Flutter User Group' | ||
| mirror: 'flutter-io.cn' | ||
| urls: | ||
| pubhosted: 'https://pub.flutter-io.cn' | ||
| flutterstorage: 'https://storage.flutter-io.cn' | ||
| issues: 'https://github.com/cfug/flutter.cn/issues/new/choose' | ||
| group: https://github.com/cfug | ||
| - group: 'Shanghai Jiao Tong University *nix User Group' | ||
| mirror: 'mirror.sjtu.edu.cn' | ||
| urls: | ||
| pubhosted: 'https://mirror.sjtu.edu.cn/flutter-infra' | ||
| flutterstorage: 'https://mirror.sjtu.edu.cn' | ||
| issues: 'https://github.com/sjtug/mirror-requests' | ||
| group: https://github.com/sjtug | ||
| - group: 'Tsinghua University TUNA Association' | ||
| mirror: 'mirrors.tuna.tsinghua.edu.cn' | ||
| urls: | ||
| pubhosted: 'https://mirrors.tuna.tsinghua.edu.cn/dart-pub' | ||
| flutterstorage: 'https://mirrors.tuna.tsinghua.edu.cn/flutter' | ||
| issues: 'https://github.com/tuna/issues' | ||
| group: https://tuna.moe | ||
|
|
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,6 @@ | ||
| {{site.alert.secondary}} | ||
| 如果你正在中国的网络环境下配置 Flutter, | ||
| 请参考 [在中国网络环境下使用 Flutter][] 文档. | ||
| {{site.alert.end}} | ||
|
|
||
| [在中国网络环境下使用 Flutter]: https://flutter.cn/community/china |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| {{site.alert.important}} | ||
| If you're in China, read [Using Flutter in China][]. | ||
| If you develop apps in China, check out [using Flutter in China][]. | ||
| {{site.alert.end}} | ||
|
|
||
| [Using Flutter in China]: {{site.url}}/community/china | ||
| [using Flutter in China]: {{site.url}}/community/china |
This file was deleted.
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,35 @@ | ||
|
|
||
| {% assign id = include.ref-os | downcase -%} | ||
| {% assign mainpath = include.filepath -%} | ||
| {%- case id %} | ||
| {% when 'windows','macos' %} | ||
| {%- assign file-format = 'zip' %} | ||
| {% else %} | ||
| {%- assign file-format = 'tar.xz' %} | ||
| {% endcase %} | ||
| {%- if id == 'chromeos' %} | ||
| {% assign plat = 'linux' %} | ||
| {%- else %} | ||
| {% assign plat = id %} | ||
| {% endif %} | ||
| {% capture filepath -%}{{mainpath | replace: "opsys", plat}}{{file-format}} {% endcapture -%} | ||
|
|
||
|
|
||
| <div id="{{id}}-dl" class="tab-pane | ||
| {%- if id == 'windows' %} active {% endif %}" | ||
| role="tabpanel" aria-labelledby="{{id}}-dl-tab" markdown="1"> | ||
|
|
||
| To download the {{include.ref-os}} 3.13 version of the Flutter SDK, | ||
| you would change the original URL from: | ||
|
|
||
| ```terminal | ||
| https://storage.googleapis.com/{{filepath}} | ||
| ``` | ||
|
|
||
| to the mirror URL: | ||
|
|
||
| ```terminal | ||
| https://storage.flutter-io.cn/{{filepath}} | ||
| ``` | ||
|
|
||
| </div> |
| Original file line number | Diff line number | Diff line change | ||||
|---|---|---|---|---|---|---|
| @@ -0,0 +1,124 @@ | ||||||
| {% assign id = include.ref-os | downcase -%} | ||||||
| {% assign jsonurl = 'https://storage.googleapis.com/flutter_infra_release/releases/releases_{{id}}.json' %} | ||||||
| {% assign os = include.ref-os -%} | ||||||
| {% assign sdk = include.sdk -%} | ||||||
|
|
||||||
| {% if id == 'windows' -%} | ||||||
| {% assign shell = 'Powershell' -%} | ||||||
| {% assign prompt = 'C:\>' -%} | ||||||
| {% assign comtoset = '$env:' -%} | ||||||
| {% assign installdirsuggestion = '`%USERPROFILE%\dev`' %} | ||||||
| {% capture envvarset -%}{{prompt}} {{comtoset}}{% endcapture -%} | ||||||
| {% capture setpath -%}{{envvarset}}PATH = $pwd.PATH + "/flutter/bin",$env:PATH -join ";"{% endcapture -%} | ||||||
| {% capture newdir -%}{{prompt}} New-Item -Path '{{installdirsuggestion}}' -ItemType Directory{% endcapture -%} | ||||||
| {% capture unzip -%} {{prompt}} Extract-Archive:{% endcapture -%} | ||||||
| {% capture permaddexample -%} | ||||||
| $newPath = $pwd.PATH + "/flutter/bin",$env:PATH -join ";" | ||||||
| [System.Environment]::SetEnvironmentVariable('Path',$newPath,User) | ||||||
| [System.Environment]::SetEnvironmentVariable('PUB_HOSTED_URL','https://pub.flutter-io.cn',User) | ||||||
| [System.Environment]::SetEnvironmentVariable('FLUTTER_STORAGE_BASE_URL','https://storage.flutter-io.cn',User) | ||||||
| {% endcapture -%} | ||||||
| {% else -%} | ||||||
| {% assign shell = 'your terminal' -%} | ||||||
| {% assign prompt = '$' -%} | ||||||
| {% assign comtoset = 'export ' -%} | ||||||
| {% assign installdirsuggestion = '`~/dev`' %} | ||||||
| {% capture envvarset -%}{{prompt}} {{comtoset}}{% endcapture -%} | ||||||
| {% capture setpath -%}{{envvarset}}PATH="$PWD/flutter/bin:$PATH"{% endcapture -%} | ||||||
| {% capture newdir -%}{{prompt}} mkdir ~/dev{% endcapture -%} | ||||||
| {% if id == 'macos' %} | ||||||
| {% capture unzip -%} {{prompt}} unzip{% endcapture -%} | ||||||
| {% else %} | ||||||
| {% capture unzip -%} {{prompt}} tar -xf{% endcapture -%} | ||||||
| {% endif %} | ||||||
| {% capture permaddexample -%} | ||||||
| cat <<EOT >> ~/.zprofile | ||||||
| {{envvarset}}PUB_HOSTED_URL="https://pub.flutter-io.cn" | ||||||
| {{envvarset}}FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn" | ||||||
| {{setpath}} | ||||||
| EOT | ||||||
| {% endcapture -%} | ||||||
| {% endif -%} | ||||||
| {%- case id %} | ||||||
| {% when 'windows','macos' %} | ||||||
| {%- assign file-format = 'zip' %} | ||||||
| {%- assign download-os = id %} | ||||||
| {% when 'linux','chromeos' %} | ||||||
| {%- assign download-os = 'linux' %} | ||||||
| {%- assign file-format = 'tar.xz' %} | ||||||
| {% endcase %} | ||||||
|
|
||||||
| <div id="{{id}}" class="tab-pane | ||||||
| {%- if id == 'windows' %} active {% endif %}" | ||||||
| role="tabpanel" aria-labelledby="{{id}}-tab" markdown="1"> | ||||||
|
|
||||||
| This procedure requires using {{shell}}. | ||||||
|
|
||||||
| 1. Open a new window in {{shell}} to prepare running scripts. | ||||||
|
|
||||||
| 1. Set `PUB_HOSTED_URL` to your mirror site. | ||||||
|
|
||||||
| ```terminal | ||||||
| {{envvarset}}PUB_HOSTED_URL="https://pub.flutter-io.cn" | ||||||
| ``` | ||||||
|
|
||||||
| 1. Set `FLUTTER_STORAGE_BASE_URL` to your mirror site. | ||||||
|
|
||||||
| ```terminal | ||||||
| {{envvarset}}FLUTTER_STORAGE_BASE_URL="https://storage.flutter-io.cn" | ||||||
| ``` | ||||||
|
|
||||||
| 1. Download the Flutter archive from your mirror site. | ||||||
| In your preferred browser, go to | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
| [Flutter SDK archive](https://flutter.cn/docs/release/archive?tab={{id}}). | ||||||
|
parlough marked this conversation as resolved.
|
||||||
|
|
||||||
| 1. Create a folder where you can install Flutter. then change into it. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| Consider a path like {{installdirsuggestion}}. | ||||||
|
|
||||||
| ```terminal | ||||||
| {{newdir}}; cd {{installdirsuggestion}} | ||||||
| ``` | ||||||
|
|
||||||
| 1. Extract the the SDK from the {{file-format}} archive file. | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
|
||||||
|
|
||||||
| This example assumes you downloaded the {{os}} version of the Flutter SDK. | ||||||
|
|
||||||
| ```terminal | ||||||
| {{unzip}} {{sdk | replace: "opsys", download-os}}{{file-format}} | ||||||
| ``` | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I recommend adding an extra sentence to explicitly explain that they need to use the exact name of the specific bundle they downloaded here. When there are terminal code blocks, readers often just copy paste without much consideration, or they may be new to this type of activity and may not know. |
||||||
|
|
||||||
| 1. Add Flutter to your `PATH` environment variable. | ||||||
|
|
||||||
| ```terminal | ||||||
| {{setpath}} | ||||||
| ``` | ||||||
|
|
||||||
| 1. Run Flutter Doctor to verify your installation. | ||||||
|
|
||||||
| ```terminal | ||||||
| {{prompt}} flutter doctor | ||||||
| ``` | ||||||
|
|
||||||
| 1. Return to the [setting up Flutter]({{site.url}}/get-started/editor) | ||||||
| guide and continue from that procedure. | ||||||
|
|
||||||
| From this example, `flutter pub get` fetches packages from `flutter-io.cn`, | ||||||
| in any terminal where you set `PUB_HOSTED_URL` and `FLUTTER_STORAGE_BASE_URL`. | ||||||
|
Comment on lines
+106
to
+107
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. What do you intend to mean by "from this example"? "After completing the steps of this procedure"? |
||||||
|
|
||||||
| Any environment variables set using `{{comtoset}}` in this procedure | ||||||
| only apply to the current window. | ||||||
|
|
||||||
| To set these values on a permanent basis, | ||||||
| {% if id == 'windows' -%} | ||||||
| set the enviroment variables as in the following example: | ||||||
| {% else -%} | ||||||
| append those three `export` commands to the `*rc` or `*profile` | ||||||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's been a while since the
Suggested change
|
||||||
| file that your preferred shell uses. This would resemble the following: | ||||||
| {% endif -%} | ||||||
|
|
||||||
| ```terminal | ||||||
| {{permaddexample}} | ||||||
| ``` | ||||||
|
|
||||||
| </div> | ||||||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,44 @@ | ||
|
|
||
| {% assign id = include.os | downcase -%} | ||
|
|
||
| <div id="{{id}}-pub" class="tab-pane | ||
| {%- if id == 'windows' %} active {% endif %}" | ||
| role="tabpanel" aria-labelledby="{{id}}-tab" markdown="1"> | ||
|
|
||
| 1. Configure a proxy. | ||
| To configure a proxy, check out the [Dart documentation on proxies][]. | ||
|
|
||
| {% comment %} | ||
| From https://github.com/flutter/website/issues/2556#issuecomment-481566476 | ||
| {% endcomment %} | ||
|
|
||
| 1. Verify that your `PUB_HOSTED_URL` environment variable is either unset | ||
| or empty. | ||
|
|
||
| {% if id == 'windows' -%} | ||
|
|
||
| ```terminal | ||
| {{prompt}} echo $env:PUB_HOSTED_URL | ||
| ``` | ||
|
|
||
| If this command returns any value, unset it. | ||
|
|
||
| ```terminal | ||
| {{prompt}} Remove-Item $env:PUB_HOSTED_URL | ||
| ``` | ||
|
|
||
| {% else -%} | ||
|
|
||
| ```terminal | ||
| {{prompt}} echo $PUB_HOSTED_URL | ||
| ``` | ||
|
|
||
| If this command returns any value, unset it. | ||
|
|
||
| ```terminal | ||
| {{prompt}} unset $PUB_HOSTED_URL | ||
| ``` | ||
|
|
||
| {% endif %} | ||
|
|
||
| </div> |
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"Archive" implies the entire archive, perhaps "build" or "installation bundle".
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
A zip file or a tar file are archive file formats. Going to keep as-is.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's technically true, but it's quite confusing since it uses "archive" to mean two different things in this same step. It reads as if it's telling me to download the entire archive page.