Document flavor-specific web resources

未关闭 适合新手
#14,165 1 条评论 0 个 reaction 已指派 0 人 在 GitHub 查看

维护者通常 1 天内回复

还没有人认领这个 Issue。

评估

难度
2/5
预计耗时
1-3 小时
新手友好度
78/100
Issue 类型
文档
描述清晰度
描述清楚
活跃度
活跃
技术栈
dart, flutter
领域
cli, documentation

调研方向

从 docs.flutter.dev 上现有的 Web 指南和 Flutter CLI 中关于 flutter run 与 flutter build web 的文档开始;issue 没有指定具体文件。说明 web/flavors/<flavor>/ 结构、flavor 专属文件如何覆盖共享资源,以及资源如何回退到 web/。指南涵盖两个示例命令以及覆盖和回退行为后,即算完成。

由索引模型根据 Issue 内容生成。

描述

act.await-dev-pr co.request d.new-feature dev.flavors e1-hours p2-medium st.blocked t.cli-tools target.web
Related code pull request or issue

https://github.com/flutter/flutter/pull/197545

Feature summary

The proposed support for flavor-specific web resources introduces a new directory convention for customizing web resources using the existing --flavor argument.

If accepted, the documentation should cover the web/flavors/<flavor>/ directory structure, resource overrides and fallback behavior, and usage with flutter run and flutter build web.

Type of documentation needed
  • New conceptual page or guide
  • Update to an existing guide on docs.flutter.dev
  • Cookbook recipe or practical code sample
  • CLI or tooling documentation
  • Platform support or integration guide
  • Breaking change migration guide
Code snippet or usage example

Example directory structure:

web/
  index.html
  manifest.json
  icons/
  flavors/
    staging/
      index.html
      manifest.json
    production/
      manifest.json

Running or building with a specific flavor:

flutter run -d chrome --flavor staging
flutter build web --flavor production

Files under web/flavors/<flavor>/ override files at the corresponding paths in web/. Resources without a flavor-specific override fall back to the shared directory.

Additional context or resources
  • Related feature request: flutter/flutter#141371.
  • Additional design details: flutter/rfc#49.
主要语言
Dart
星标
3.1k
派生
3.5k
平均合并
2 天 10 小时
30 天内合并 PR
88

环境准备

从这里开始

  1. 先读完整个 Issue,再读项目的贡献指南。
  2. 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
  3. Fork 仓库,在一个分支上完成修改。
  4. 提交 Pull Request,并在描述里引用这个 Issue 编号。

flutter/website 的其他 Issue

查看 flutter/website 的全部 Issue

相似的 Issue

更多 Dart Issue

把新 issue 发到你的邮箱

精选适合新手参与的 GitHub issue 摘要。