{"id":482,"date":"2026-04-04T15:40:54","date_gmt":"2026-04-04T07:40:54","guid":{"rendered":"https:\/\/www.linerroom.cn\/?p=482"},"modified":"2026-04-04T16:13:55","modified_gmt":"2026-04-04T08:13:55","slug":"flutter%e9%95%9c%e5%83%8f%e6%ba%90","status":"publish","type":"post","link":"https:\/\/www.linerroom.cn\/?p=482","title":{"rendered":"FLutter\u955c\u50cf\u6e90"},"content":{"rendered":"\n<div class=\"wp-block-jetpack-markdown\"><h2>Flutter \u56fd\u5185\u955c\u50cf\u4e00\u89c8<\/h2>\n<p>\u672c\u6587\u6863\u6c47\u603b\u5e38\u7528\u7684 Flutter\/Dart \u56fd\u5185\u955c\u50cf\u5730\u5740\uff0c\u5305\u542b <code>PUB_HOSTED_URL<\/code>\uff08Dart\/Flutter \u5305\u7d22\u5f15\uff09\u4e0e <code>FLUTTER_STORAGE_BASE_URL<\/code>\uff08Flutter \u4e8c\u8fdb\u5236\/\u8d44\u6e90\u5b58\u50a8\uff09\u5b57\u6bb5\uff0c\u65b9\u4fbf\u5728\u56fd\u5185\u73af\u5883\u4e2d\u52a0\u901f Flutter \u5f00\u53d1\u4e0e\u5305\u7ba1\u7406\u3002<\/p>\n<h3>\u5feb\u901f\u6982\u89c8<\/h3>\n<table>\n<thead>\n<tr>\n<th style=\"text-align:left\">\u955c\u50cf\u540d\u79f0<\/th>\n<th style=\"text-align:center\">PUB_HOSTED_URL<\/th>\n<th style=\"text-align:center\">FLUTTER_STORAGE_BASE_URL<\/th>\n<th style=\"text-align:left\">\u7279\u70b9<\/th>\n<\/tr>\n<\/thead>\n<tbody>\n<tr>\n<td style=\"text-align:left\">\u5b98\u65b9\u4e2d\u56fd\u955c\u50cf<\/td>\n<td style=\"text-align:center\">https:\/\/pub.flutter-io.cn<\/td>\n<td style=\"text-align:center\">https:\/\/storage.flutter-io.cn<\/td>\n<td style=\"text-align:left\">CFUG \u7ef4\u62a4\uff0c\u6700\u7a33\u5b9a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u6e05\u534e\u5927\u5b66<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/dart-pub<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.tuna.tsinghua.edu.cn\/flutter<\/td>\n<td style=\"text-align:left\">\u66f4\u65b0\u5feb\uff0c\u8d44\u6e90\u5168<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u963f\u91cc\u4e91<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.aliyun.com\/dart-pub<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.aliyun.com\/flutter<\/td>\n<td style=\"text-align:left\">\u56fd\u5185 CDN\uff0c\u901f\u5ea6\u5feb<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u4e0a\u6d77\u4ea4\u5927<\/td>\n<td style=\"text-align:center\">https:\/\/mirror.sjtu.edu.cn\/dart-pub<\/td>\n<td style=\"text-align:center\">https:\/\/mirror.sjtu.edu.cn\/flutter<\/td>\n<td style=\"text-align:left\">\u6559\u80b2\u7f51\u4f18\u5148\uff0c\u7a33\u5b9a<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u817e\u8baf\u4e91<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.cloud.tencent.com\/dart-pub<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.cloud.tencent.com\/flutter<\/td>\n<td style=\"text-align:left\">\u5357\u65b9\u7528\u6237\u901f\u5ea6\u66f4\u4f73<\/td>\n<\/tr>\n<tr>\n<td style=\"text-align:left\">\u534e\u4e3a\u4e91<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.huaweicloud.com\/dart-pub<\/td>\n<td style=\"text-align:center\">https:\/\/mirrors.huaweicloud.com\/flutter<\/td>\n<td style=\"text-align:left\">\u4f01\u4e1a\u7ea7\u7a33\u5b9a\u6027<\/td>\n<\/tr>\n<\/tbody>\n<\/table>\n<\/div>\n\n\n\n<h2 class=\"wp-block-heading\"><strong>PowerShell \u4e13\u5c5e<mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u4e34\u65f6<\/mark>\u52a0\u901f\u547d\u4ee4<\/strong><\/h2>\n\n\n\n<pre class=\"wp-block-code\"><code># 1. \u6b63\u786e\u8bbe\u7f6ePowerShell\u73af\u5883\u53d8\u91cf\uff08\u963f\u91cc\u4e91\u955c\u50cf\uff09\n$env:PUB_HOSTED_URL = \"https:\/\/mirrors.aliyun.com\/dart-pub\"\n$env:FLUTTER_STORAGE_BASE_URL = \"https:\/\/mirrors.aliyun.com\/flutter\"\n\n# 2. \u5f7b\u5e95\u6e05\u7406\u7f13\u5b58\u548c\u9501\u6587\u4ef6\uff08\u89e3\u51b3\u6b8b\u7559\u95ee\u9898\uff09\nflutter clean\nRemove-Item pubspec.lock -Force\n\n# 3. \u91cd\u65b0\u83b7\u53d6\u4f9d\u8d56\uff08\u6b63\u5e383-10\u79d2\u5b8c\u6210\uff09\nflutter pub get<\/code><\/pre>\n\n\n\n<h3 class=\"wp-block-heading\">\u9a8c\u8bc1\u73af\u5883\u53d8\u91cf\u662f\u5426\u751f\u6548<\/h3>\n\n\n\n<p>\u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u786e\u8ba4\u8f93\u51fa\u6b63\u786e\u7684\u955c\u50cf\u5730\u5740\uff1a<\/p>\n\n\n\n<pre class=\"wp-block-code\"><code>echo $env:PUB_HOSTED_URL\necho $env:FLUTTER_STORAGE_BASE_URL<\/code><\/pre>\n\n\n\n<h2 class=\"wp-block-heading\"><mark style=\"background-color:rgba(0, 0, 0, 0)\" class=\"has-inline-color has-vivid-red-color\">\u6c38\u4e45<\/mark>\u914d\u7f6e\u56fd\u5185\u955c\u50cf<\/h2>\n\n\n\n<p>\u53f3\u952e\u300c\u6b64\u7535\u8111\u300d\u2192 <strong>\u5c5e\u6027<\/strong> \u2192 <strong>\u9ad8\u7ea7\u7cfb\u7edf\u8bbe\u7f6e<\/strong> \u2192 <strong>\u73af\u5883\u53d8\u91cf<\/strong> <\/p>\n\n\n\n<p>\u5728\u300c\u7528\u6237\u53d8\u91cf\u300d\u680f\uff0c\u70b9\u51fb\u300c\u65b0\u5efa\u300d\uff0c\u6dfb\u52a0 2 \u4e2a\u7cfb\u7edf\u53d8\u91cf\uff1a<\/p>\n\n\n\n<figure class=\"wp-block-table\"><table class=\"has-fixed-layout\"><tbody><tr><td class=\"has-text-align-center\" data-align=\"center\"><strong>\u53d8\u91cf\u540d<\/strong><\/td><td class=\"has-text-align-center\" data-align=\"center\"><code><strong>\u53d8\u91cf\u503c<\/strong><\/code><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">PUB_HOSTED_URL<\/td><td class=\"has-text-align-center\" data-align=\"center\"><a href=\"https:\/\/mirrors.aliyun.com\/dart-pub\">https:\/\/mirrors.aliyun.com\/dart-pub<\/a><\/td><\/tr><tr><td class=\"has-text-align-center\" data-align=\"center\">FLUTTER_STORAGE_BASE_URL<\/td><td class=\"has-text-align-center\" data-align=\"center\"><a href=\"https:\/\/mirrors.aliyun.com\/flutter\">https:\/\/mirrors.aliyun.com\/flutter<\/a><\/td><\/tr><\/tbody><\/table><\/figure>\n\n\n\n<p>\u70b9\u51fb\u300c\u786e\u5b9a\u300d\u4fdd\u5b58\uff0c<strong>\u5b8c\u5168\u5173\u95ed\u6240\u6709\u7ec8\u7aef \/ IDE\uff08VS Code\/Android Studio\uff09<\/strong>\uff0c\u91cd\u65b0\u6253\u5f00\u540e\u6c38\u4e45\u751f\u6548\u3002<\/p>\n\n\n\n<p><\/p>\n","protected":false},"excerpt":{"rendered":"<p>PowerShell \u4e13\u5c5e\u4e34\u65f6\u52a0\u901f\u547d\u4ee4 \u9a8c\u8bc1\u73af\u5883\u53d8\u91cf\u662f\u5426\u751f\u6548 \u6267\u884c\u4ee5\u4e0b\u547d\u4ee4\uff0c\u786e\u8ba4\u8f93\u51fa\u6b63\u786e\u7684\u955c\u50cf\u5730\u5740\uff1a \u6c38\u4e45\u914d\u7f6e [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"advanced_seo_description":"","jetpack_seo_html_title":"","jetpack_seo_noindex":false,"_jetpack_memberships_contains_paid_content":false,"footnotes":""},"categories":[15],"tags":[],"class_list":["post-482","post","type-post","status-publish","format-standard","hentry","category-flutter"],"jetpack_featured_media_url":"","jetpack-related-posts":[],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=\/wp\/v2\/posts\/482","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=482"}],"version-history":[{"count":6,"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=\/wp\/v2\/posts\/482\/revisions"}],"predecessor-version":[{"id":492,"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=\/wp\/v2\/posts\/482\/revisions\/492"}],"wp:attachment":[{"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=482"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=482"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.linerroom.cn\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=482"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}