flutter-china-deploy

Flutter 项目中国环境部署加速专家。用于在 Flutter 项目初始化、部署和运行时配置国内镜像加速。当用户需要:(1) 初始化 Flutter 项目并配置中国镜像加速 (2) 解决 Flutter 依赖下载慢的问题 (3) 配置 Gradle/Maven 国内镜像 (4) 快速部署 Flutter 项目到手机/模拟器 时使用此 Skill。

155 stars

Best use case

flutter-china-deploy is best used when you need a repeatable AI agent workflow instead of a one-off prompt.

Flutter 项目中国环境部署加速专家。用于在 Flutter 项目初始化、部署和运行时配置国内镜像加速。当用户需要:(1) 初始化 Flutter 项目并配置中国镜像加速 (2) 解决 Flutter 依赖下载慢的问题 (3) 配置 Gradle/Maven 国内镜像 (4) 快速部署 Flutter 项目到手机/模拟器 时使用此 Skill。

Teams using flutter-china-deploy should expect a more consistent output, faster repeated execution, less prompt rewriting.

When to use this skill

  • You want a reusable workflow that can be run more than once with consistent structure.

When not to use this skill

  • You only need a quick one-off answer and do not need a reusable workflow.
  • You cannot install or maintain the underlying files, dependencies, or repository context.

Installation

Claude Code / Cursor / Codex

$curl -o ~/.claude/skills/03_Mobile_FlutterChinaDeploy/SKILL.md --create-dirs "https://raw.githubusercontent.com/boshi-xixixi/TraeSkill/main/.trae/Skills/03_Mobile_FlutterChinaDeploy/SKILL.md"

Manual Installation

  1. Download SKILL.md from GitHub
  2. Place it in .claude/skills/03_Mobile_FlutterChinaDeploy/SKILL.md inside your project
  3. Restart your AI agent — it will auto-discover the skill

How flutter-china-deploy Compares

Feature / Agentflutter-china-deployStandard Approach
Platform SupportNot specifiedLimited / Varies
Context Awareness High Baseline
Installation ComplexityUnknownN/A

Frequently Asked Questions

What does this skill do?

Flutter 项目中国环境部署加速专家。用于在 Flutter 项目初始化、部署和运行时配置国内镜像加速。当用户需要:(1) 初始化 Flutter 项目并配置中国镜像加速 (2) 解决 Flutter 依赖下载慢的问题 (3) 配置 Gradle/Maven 国内镜像 (4) 快速部署 Flutter 项目到手机/模拟器 时使用此 Skill。

Where can I find the source code?

You can find the source code on GitHub using the link provided at the top of the page.

SKILL.md Source

# Flutter 中国环境部署加速

## 快速开始

当用户需要部署 Flutter 项目时,按以下步骤执行:

### 1. 设置环境变量镜像

在终端执行或写入 `~/.zshrc`:

```bash
export PUB_HOSTED_URL=https://pub.flutter-io.cn
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn
```

### 2. 项目初始化 (FVM 版)

```bash
fvm install stable
fvm use stable --force
fvm flutter pub get
```

## Gradle 配置优化

### gradle-wrapper.properties

修改 `android/gradle/wrapper/gradle-wrapper.properties`:

```properties
distributionUrl=https\://mirrors.cloud.tencent.com/gradle/gradle-8.10.2-all.zip
```

### settings.gradle.kts

在 `android/settings.gradle.kts` 的 `repositories` 块添加:

```kotlin
repositories {
    maven { url = uri("https://storage.flutter-io.cn/download.flutter.io") }
    maven { url = uri("https://maven.aliyun.com/repository/google") }
    maven { url = uri("https://maven.aliyun.com/repository/public") }
    maven { url = uri("https://maven.aliyun.com/repository/gradle-plugin") }
    google()
    mavenCentral()
}
```

### build.gradle.kts

在 `android/build.gradle.kts` 同样配置 Maven 镜像。

### gradle.properties

在 `android/gradle.properties` 添加优化配置:

```properties
kotlin.compiler.execution.strategy=in-process
org.gradle.daemon=false
android.useAndroidX=true
android.enableJetifier=true
```

## Android SDK 配置

### local.properties

创建或修改 `android/local.properties`:

```properties
sdk.dir=/Volumes/MacOS/Android/sdk
```

### 环境变量

在 `~/.zshrc` 添加:

```bash
export ANDROID_HOME=/Volumes/MacOS/Android/sdk
export PATH=$PATH:$ANDROID_HOME/tools:$ANDROID_HOME/platform-tools
```

## 运行项目

```bash
export FLUTTER_STORAGE_BASE_URL=https://storage.flutter-io.cn && \
export PUB_HOSTED_URL=https://pub.flutter-io.cn && \
fvm flutter run -d <设备ID>
```

## 常见问题排查

| 错误信息 | 解决方案 |
|---------|---------|
| Timeout waiting to lock build logic queue | `pkill -f gradle` 并删除 `android/.gradle` |
| Could not find io.flutter:... | 检查 `settings.gradle.kts` 是否包含 `download.flutter.io` 镜像 |
| Operation not permitted | 检查 `GRADLE_USER_HOME` 路径权限 |

## 配置脚本

使用 `scripts/configure_mirrors.py` 自动配置:

```bash
# 检查当前配置状态
python3 scripts/configure_mirrors.py --check

# 配置 Shell 环境变量
python3 scripts/configure_mirrors.py --shell

# 配置 Gradle 镜像 (指定项目路径)
python3 scripts/configure_mirrors.py --project /path/to/flutter/project --gradle

# 执行所有配置
python3 scripts/configure_mirrors.py --project /path/to/flutter/project --all
```

Related Skills

Flutter Development Expert

155
from boshi-xixixi/TraeSkill

专注于构建高性能、可扩展且架构清晰的 Flutter 应用。涵盖整洁架构、高级状态管理和深度性能优化。

trae-project-setup

155
from boshi-xixixi/TraeSkill

Trae 项目规范化配置专家。用于快速初始化 Trae 项目配置文件、生成项目规则、用户偏好设置和 Skill 模板。当用户需要:(1) 初始化新项目的 Trae 配置 (2) 生成 .trae 目录结构 (3) 创建 USER_PREFERENCES.md 用户偏好文件 (4) 创建 project_rules.md 项目规则文件 (5) 创建新的 Skill 模板 时使用此 Skill。

skill-creator

155
from boshi-xixixi/TraeSkill

Guide for creating effective skills. This skill should be used when users want to create a new skill (or update an existing skill) that extends Claude's capabilities with specialized knowledge, workflows, or tool integrations.

user-customization

155
from boshi-xixixi/TraeSkill

指导用户如何自定义 Trae Skills 的配置,包括覆盖角色设定、调整技术偏好和定义全局规则。

Operations & Growth Expert

155
from boshi-xixixi/TraeSkill

专注于内容创作(文案、运营稿件)、运营数据分析、以及营销活动策划与设置。帮助项目实现从“可用”到“好用”及“增长”的闭环。

AI Engineer

155
from boshi-xixixi/TraeSkill

专注于 LLM 应用开发,涵盖 RAG 和 LangChain 架构。

Security Specialist

155
from boshi-xixixi/TraeSkill

应用安全专家,专注于认证授权、数据保护和合规性审计。当用户需要:(1) 设计安全的登录认证系统 (2) 进行安全代码审查 (3) 检查 GDPR/隐私合规 (4) 防范常见安全漏洞 (OWASP Top 10) 时使用此 Skill。

seo-technical-expert

155
from boshi-xixixi/TraeSkill

技术 SEO 专家,擅长网站性能优化、结构化数据、移动端优化和技术问题诊断。适用于网站技术实现、性能调优和搜索引擎抓取优化时使用。

seo-linkbuilding

155
from boshi-xixixi/TraeSkill

链接建设与社交 SEO 专家,擅长外链获取策略、社交媒体优化和品牌建设。适用于提升网站权威度、获取高质量反向链接和社交信号增强时使用。

seo-content-strategy

155
from boshi-xixixi/TraeSkill

SEO 内容策略专家,擅长关键词研究、内容规划、长尾词布局和内容营销策略。适用于创建 SEO 友好的文章 landing page 和营销内容时使用。

seo-analytics

155
from boshi-xixixi/TraeSkill

SEO 数据分析专家,擅长 Google Search Console、Google Analytics 数据分析、排名追踪和 ROI 计算。适用于 SEO 效果评估、策略调整和数据驱动决策时使用。

pdf

155
from boshi-xixixi/TraeSkill

Comprehensive PDF manipulation toolkit for extracting text and tables, creating new PDFs, merging/splitting documents, and handling forms. When Claude needs to fill in a PDF form or programmatically process, generate, or analyze PDF documents at scale.