Repository navigation
Conversation
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
On the web,
version/buildNumbercome fromversion.json, fetched from the server at runtime. It describes the currently deployed bundle, so a client running a stale cached bundle reports the newer version.Since Flutter 3.47.0 (flutter/flutter#187935),
flutter_toolsinjects the app's build name and number as the dart-definesFLUTTER_BUILD_NAME/FLUTTER_BUILD_NUMBER(exposed asappBuildName/appBuildNumber). They are compiled into the running bundle.This PR makes the web implementation use them for
version/buildNumberwhen defined:bool.hasEnvironment, so the minimum Flutter version is unchanged; on older SDKs they're undefined and nothing changes;appName/packageNamestill come fromversion.json;version.jsonfetch fails;The web plugin constructor gains two optional positional parameters (build name / number) for tests, defaulting to the compiled values. The mocked web tests pass
nullso they keep covering theversion.jsonpath. Two new tests cover the compile-time path.Related Issues
Checklist
CHANGELOG.mdnor the plugin version inpubspec.yamlfiles.flutter analyze) does not report any problems on my PR.Breaking Change