-
Notifications
You must be signed in to change notification settings - Fork 9.8k
[url_launcher] Initialize previousAutomaticSystemUiAdjustment in launch #2757
Conversation
@@ -73,7 +73,7 @@ Future<bool> launch( | |||
message: 'To use webview or safariVC, you need to pass' | |||
'in a web URL. This $urlString is not a web URL.'); | |||
} | |||
bool previousAutomaticSystemUiAdjustment; | |||
bool previousAutomaticSystemUiAdjustment = true; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you know why true
instead of false
? Could you add a comment?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I just added a comment. I think it should be true because if it's false when the statusBarBrightness is set, then there will be a delay in computing the system UI.
|
||
// The automaticSystemUiAdjustment should be set before the launch | ||
// and not null after the launch result is complete. | ||
expect(binding.renderView.automaticSystemUiAdjustment, isNotNull); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do you want to be more precise here and below and expect that this is true
?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes it should be true. I updated and ran the test again.
Co-authored-by: Emmanuel Garcia <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM!
* master: (96 commits) Update README.md (flutter#2768) [url_launcher_web] Launch mailto urls in same window in Safari (flutter#2740) update README with enableJavaScript info (flutter#2766) Run publish ci check on master (flutter#2764) [image_picker] Add documentation for Android external storage permissions (flutter#2765) [package_info] add support for macos to package_info plugin (flutter#2618) fixed detach from engine logic (flutter#2759) [url_launcher] Initialize previousAutomaticSystemUiAdjustment in launch (flutter#2757) [google_maps_flutter] add todo on skipped test. (flutter#2752) [google_maps_flutter] use `WaitUntilTouchesEndedPolicy` to fix the cameraIdle not called issue on iOS (flutter#2746) Use Xvfb for Linux desktop tests (flutter#2750) update lower dart bound to 2.1.0 (flutter#2751) [camera] Update lower bound of dart dependency to 2.1.0. (flutter#2749) [battery] update dart deps lower bound to 2.1.0 (flutter#2748) [android_alarm_manager] update dart deps lower bound to 2.1.0 (flutter#2747) [url_launcher] Add web to example app. (flutter#2736) [in_app_purchase] update docs to warn about `completePurchase` (flutter#2739) [video_player] upgraded video_player to use pigeon (flutter#2544) [video_player]: fixed platform_interface unit tests (flutter#2745) [video_player]: added test class to fix video_player unit tests (flutter#2744) ... # Conflicts: # packages/quick_actions/ios/Classes/FLTQuickActionsPlugin.m
…ch (flutter#2757) * initialize previousAutomaticSystemUiAdjustment * updated changelog * add system ui adjustment documentation * tupdate comment formatting Co-authored-by: Emmanuel Garcia <[email protected]> * expected value should be true Co-authored-by: Emmanuel Garcia <[email protected]>
…ch (flutter#2757) * initialize previousAutomaticSystemUiAdjustment * updated changelog * add system ui adjustment documentation * tupdate comment formatting Co-authored-by: Emmanuel Garcia <[email protected]> * expected value should be true Co-authored-by: Emmanuel Garcia <[email protected]>
…ch (flutter#2757) * initialize previousAutomaticSystemUiAdjustment * updated changelog * add system ui adjustment documentation * tupdate comment formatting Co-authored-by: Emmanuel Garcia <[email protected]> * expected value should be true Co-authored-by: Emmanuel Garcia <[email protected]>
Description
The value of previousAutomaticSystemUiAdjustment is set to true in launch method before statusBarBrightness is checked. This change prevents the automaticSystemUiAdjustment of the renderView from being set to null after statusBarBrightness is checked. This ensures that _updateSystemChrome() is called before window rendering.
Related Issues
Fixes flutter/flutter#43373
Checklist
Before you create this PR confirm that it meets all requirements listed below by checking the relevant checkboxes (
[x]
). This will ensure a smooth and quick review process.///
).flutter analyze
) does not report any problems on my PR.Breaking Change
Does your PR require plugin users to manually update their apps to accommodate your change?