团队协作
使用 flu-cli 进行团队协作的最佳实践。
统一项目结构
使用自定义模板
创建团队统一的项目模板:
bash
# 创建团队模板仓库
https://github.com/your-org/flutter-template.git
# 团队成员使用
flu-cli new my_project
# 选择团队自定义模板统一代码风格
配置 VSCode 片段
在项目中添加 .vscode/dart.code-snippets:
json
{
"Flutter Page": {
"prefix": "flu.stPage",
"body": ["// 团队统一的页面模板"]
}
}提交到版本控制
bash
git add .vscode/dart.code-snippets
git commit -m "feat: add team code snippets"开发流程
1. 创建功能分支
bash
git checkout -b feature/user-module2. 使用 flu-cli 生成代码
bash
flu-cli a module user
flu-cli a page user_list -f user3. 提交代码
bash
git add .
git commit -m "feat: add user module"
git push代码审查
检查点
- ✅ 使用了团队模板
- ✅ 遵循命名规范
- ✅ 代码结构清晰
- ✅ 添加了必要注释