[package_info_plus]: Use Flutter's compile-time build name/number on web instead of version.json
Maintainer thường phản hồi trong vòng 1 ngày
Đánh giá
- Độ khó
- 2/5
- Thời gian dự kiến
- 1-3 giờ
- Mức phù hợp với người mới
- 25/100
Hướng nghiên cứu
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.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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).
- Ngôn ngữ chính
- Dart
- Star
- 1.9k
- Fork
- 1.3k
- Merge trung bình
- 4 ngày 2 giờ
- Pull request đã merge (30 ngày)
- 15
Chuẩn bị môi trường
- Không có Dockerfile hay tệp Docker Compose
- Có mẫu pull request
- Đọc hướng dẫn đóng góp
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của fluttercommunity/plus_plugins
-
[Bug]: (share_plus) iOS drops the subject when sharing a uriCó thể đã có người làm @kaluli123123 đã nhận 8 ngày trước. Đang mởbug triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 82/100
fluttercommunity/plus_plugins#3994 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 1 ngày
-
[Request]: network_info_plus: use ConnectivityManager for getWifiIP and getWifiGatewayIP from Android 7 (N), so ethernet works below Android 12Có thể đã có người làm @redge-munch đã nhận 7 ngày trước. Đang mởenhancement triage
Độ khó 3/5 Nửa ngày Mức phù hợp với người mới 22/100
fluttercommunity/plus_plugins#3998 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triage
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 55/100
fluttercommunity/plus_plugins#3976 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 35/100
fluttercommunity/plus_plugins#3974 · 1 reaction ·
Maintainer thường phản hồi trong vòng 1 ngày
-
enhancement triage
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 48/100
fluttercommunity/plus_plugins#3973 ·
Maintainer thường phản hồi trong vòng 1 ngày
Tất cả issue của fluttercommunity/plus_plugins
Issue tương tự
-
discover
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 91/100
DevDogsUGA/DogPack#14 ·
-
direct-code
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
aaronified/fluenough#500 ·
Maintainer thường phản hồi trong vòng 1 ngày
-
bug: native AES-CBC byte operations read mutated input after invocationCó thể đã có người làm @harrshita123 đã nhận hôm nay. Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 76/100
google/webcrypto.dart#436 · 1 bình luận ·
Maintainer thường phản hồi trong vòng 7 ngày
-
bug
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 65/100
Maintainer thường phản hồi trong vòng 1 ngày
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 84/100
openfoodfacts/smooth-app#7831 ·
Maintainer thường phản hồi trong vòng 1 ngày