[package_info_plus]: Use Flutter's compile-time build name/number on web instead of version.json
Mantenedores costumam responder em até 1 dia
Avaliação
- Dificuldade
- 2/5
- Tempo estimado
- 1-3 horas
- Facilidade para iniciantes
- 25/100
Direção de pesquisa
Start in the package_info_plus web implementation and review its current version.json loading path. Verify the compile-time build values are preferred when available, version.json remains the fallback, and native behavior is unchanged; the linked PR #3990 indicates work is already underway.
Escrita pelo modelo de indexação a partir do texto da issue.
Descrição
Plugin
package_info_plus
Use case
On the web, PackageInfo.fromPlatform() reads version / buildNumber from version.json, fetched from the server at runtime. That file describes the currently deployed bundle, not the one running. A client on a stale cached bundle therefore reports the new version, so update gates and "running version" displays fail for exactly the users they exist for (#2675, closed as not planned). The fetch can also fail outright (#456, #3028).
Since Flutter 3.47.0 (flutter/flutter#187935), flutter_tools injects the app's pubspec version (or --build-name / --build-number) as the dart-defines FLUTTER_BUILD_NAME / FLUTTER_BUILD_NUMBER, exposed as appBuildName / appBuildNumber in package:flutter/services.dart. They are compiled into the bundle, so they always describe the code that is executing.
Proposal
In the web implementation, prefer the compile-time values when present and keep version.json as the fallback:
const _buildName = bool.hasEnvironment('FLUTTER_BUILD_NAME')
? String.fromEnvironment('FLUTTER_BUILD_NAME')
: null;
const _buildNumber = bool.hasEnvironment('FLUTTER_BUILD_NUMBER')
? String.fromEnvironment('FLUTTER_BUILD_NUMBER')
: null;
Reading the defines through bool.hasEnvironment (instead of importing appBuildName) keeps the current minimum Flutter version: older SDKs just don't define them, and behaviour is unchanged. On native platforms nothing changes.
This fixes #2675 transparently for every consumer, including SDKs that derive their release from package_info_plus (for example sentry_flutter's release name).
PR: #3990 (replaces the opt-in approach of #3874, which I closed once the Flutter side landed).
- Linguagem predominante
- Dart
- Estrelas
- 1.9k
- Forks
- 1.3k
- Merge médio
- 8h 43min
- PRs com merge (30d)
- 13
Preparar o ambiente
- Sem Dockerfile nem arquivo Docker Compose
- Tem um modelo de pull request
- Ler o guia de contribuição
Primeiros passos
- Leia a issue inteira e depois o guia de contribuição do projeto.
- Comente na issue dizendo que vai assumir — evita que duas pessoas façam o mesmo trabalho.
- Faça um fork do repositório e trabalhe em uma branch.
- Abra um pull request que referencie o número da issue.
Mais de fluttercommunity/plus_plugins
-
[Bug]: (share_plus) iOS drops the subject when sharing a uriTalvez já em andamento @kaluli123123 assumiu há 24 dias. Abertabug triage
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 82/100
fluttercommunity/plus_plugins#3994 · 1 comentário ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: device_info_plus on Linux keeps the single quotes from os-release (Gentoo)Talvez já em andamento @ChandraChaan assumiu há 1 dia. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
fluttercommunity/plus_plugins#4011 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: package_info_plus web throws StateError when the engine assetBase is relativeTalvez já em andamento @nmloc assumiu há 10 dias. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 35/100
fluttercommunity/plus_plugins#4005 ·
Mantenedores costumam responder em até 1 dia
-
[Bug]: share_plus decodes full-resolution images on the main thread when preparing iOS share previewsTalvez já em andamento @ananya-kaul assumiu há 14 dias. Aberta
Dificuldade 4/5 3-5 dias Facilidade para iniciantes 45/100
fluttercommunity/plus_plugins#4001 ·
Mantenedores costumam responder em até 1 dia
-
[Request]: network_info_plus: use ConnectivityManager for getWifiIP and getWifiGatewayIP from Android 7 (N), so ethernet works below Android 12Talvez já em andamento @redge-munch assumiu há 22 dias. Abertaenhancement triage
Dificuldade 3/5 Meio dia Facilidade para iniciantes 22/100
fluttercommunity/plus_plugins#3998 ·
Mantenedores costumam responder em até 1 dia
Todas as issues de fluttercommunity/plus_plugins
Issues semelhantes
-
enhancement
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 68/100
ymm-oss/flutter-mobile-project-template#704 ·
Mantenedores costumam responder em até 15 dias
-
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 77/100
Mantenedores costumam responder em até 1 dia
-
[Bug] MCP tools/list returns a boolean JSON Schema for get_task_stats, breaking strict clientsTalvez já em andamento @monkeyWie assumiu hoje. Aberta
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 79/100
Mantenedores costumam responder em até 2 dias
-
[Bug] 下载路径文件夹中包含空格会导致保存路径错误Abertabug | 问题
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 72/100
FoxSensei001/LoveIwara#137 ·
-
[dwds] WebkitDebugger.enable 5-second hardcoded timeout causes TimeoutException on large web appsAbertapackage:dwds
Dificuldade 2/5 1-3 horas Facilidade para iniciantes 74/100