You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
王子贤 150b32cc64 优化任务展示 1 month ago
.vscode 优化断网下的报错提示 2 months ago
android no message 2 months ago
assets 完善邀请和踢人,完善钱包枚举 2 months ago
ios ces 2 months ago
lib 优化任务展示 1 month ago
location_plugin 1. 修改发送状态错位。 4 months ago
scripts 隐藏功能 3 months ago
test 初始提交 4 months ago
.fvmrc 优化断网下的报错提示 2 months ago
.gitignore 优化断网下的报错提示 2 months ago
.metadata 初始提交 4 months ago
README.md chore(scripts): 添加 Flutter 自动化打包脚本 4 months ago
analysis_options.yaml 初始提交 4 months ago
devtools_options.yaml 排版完成钱包页面,对接玫瑰相关接口,会员中心排版约一半 4 months ago
flutter_native_splash.yaml feat(splash): 添加启动页背景图片和相关配置 3 months ago
pubspec.yaml feat(chat): 替换文本输入框为扩展文本字段以支持表情显示 2 months ago
核心组件交接文档.md docs(system): 添加核心组件交接文档 2 months ago

README.md

Build Runner 使用说明

Build Runner 是一个代码生成工具,用于自动化生成 Dart 代码。在本项目中,我们使用 build_runner 来处理各种代码生成功能,如 JSON 序列化、依赖注入等。

基本用法

flutter pub run build_runner build

这个命令会运行一次构建过程,生成所有必要的代码文件。

开发模式

在开发过程中,如果你希望在文件更改时自动重新生成代码,可以使用 watch 模式:

flutter pub run build_runner watch

这将启动一个监听器,当相关文件发生变化时自动重新构建生成的代码。

常用参数

  • --delete-conflicting-outputs: 删除与生成器输出冲突的文件
  • --build-filter: 只构建匹配指定 glob 的文件

例如: flutter pub run build_runner build --delete-conflicting-outputs

Flutter 打包脚本

为方便快速构建安装包,项目在 scripts/ 目录下提供了 iOS 与 Android 自动化脚本,均支持通过 --output 指定安装包输出位置,并透传额外的 flutter build 参数。

iOS 打包

./scripts/build_ios.sh --output /绝对路径/输出目录 [其它 flutter build 参数]
  • 默认输出目录:build/ios_release
  • --output 省略,产物会放到默认目录
  • 可追加 --no-tree-shake-icons 等 Flutter 构建参数

Android 打包

./scripts/build_android.sh --output /绝对路径/目标目录或apk文件 [其它 flutter build 参数]
  • 默认保存路径:build/android_release/app-release.apk
  • 传入目录时会把生成的 APK 拷贝到该目录;传入以 .apk 结尾的路径则会重命名后保存
  • 同样可附带任何 Flutter 构建参数(如 --no-tree-shake-icons--split-per-abi