Go to file
2025-05-03 15:33:44 +08:00
android feature: new project 2025-05-03 13:40:41 +08:00
ios feature: 完整诗词应用 2025-05-03 15:33:44 +08:00
lib feature: 完整诗词应用 2025-05-03 15:33:44 +08:00
linux feature: new project 2025-05-03 13:40:41 +08:00
macos feature: 完整诗词应用 2025-05-03 15:33:44 +08:00
test feature: new project 2025-05-03 13:40:41 +08:00
web feature: new project 2025-05-03 13:40:41 +08:00
windows feature: new project 2025-05-03 13:40:41 +08:00
.gitignore feature: new project 2025-05-03 13:40:41 +08:00
.metadata feature: new project 2025-05-03 13:40:41 +08:00
analysis_options.yaml feature: 完整诗词应用 2025-05-03 15:33:44 +08:00
pubspec.lock feature: 完整诗词应用 2025-05-03 15:33:44 +08:00
pubspec.yaml feature: 完整诗词应用 2025-05-03 15:33:44 +08:00
README.md feature: 完整诗词应用 2025-05-03 15:33:44 +08:00

项目目录结构

lib
  - components # 组件
  - helpers
    - constants # 常量
      - api.dart # 请求地址常量
      - index.dart # 常量
      - route.dart # 路由常量
    - config.dart # 环境配置
    - dio.dart # http函数
    - log.dart # 日志函数
  - logics # 逻辑
    - adapters # 数据格式化
    - entities # 数据序列化定义
      - api # 接口字段定义
      - page # 本地字段定义
      - state # 状态字段定义 
    - models # 数据
      - poetry # 请求诗词数据
    - services # 业务逻辑(view-model)
      - poetry_list.dart # 首页数据和逻辑
      - poetry_detail.dart # 诗词详情页数据和逻辑
  - router # 路由配置
    - router.dart 
  - styles # 样式
    - colors # 颜色
    - styles # 文字样式
  - ui # UI界面
    - home.dart # 首页/诗词列表页
    - poetry_detail.dart # 诗词详情页
  - utils # 工具函数
  main.dart # 入口文件

常用命令

# 生成代码
$ dart run build_runner build 
# 运行h5
$ flutter run -d chrome --web-browser-flag "--disable-web-security" --dart-define=APP_ENV=development
# ios生成环境打包
$ flutter build ipa --dart-define=APP_ENV=production
# android生产环境打包
$ flutter build apk --dart-define=APP_ENV=production