-
Notifications
You must be signed in to change notification settings - Fork 29.8k
Fix bug in setPreferredOrientations example #133503
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
The `ui.Display` is a simple data class (like `ViewportMetrics`), and does not get updated when the display size changes. The provided sample code does not work as intended, but the update does.
| /// @override | ||
| /// void didChangeMetrics() { | ||
| /// final ui.Display? display = _display; | ||
| /// final ui.Display? display = _view?.display; |
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.
If you cached the display property here, you won't actaully get the new size values of the display - you'll get the size values of whatever the display was when you cached it.
Hixie
left 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.
flutter/flutter@ec387a4...6c95737 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from d84763e04496 to 65438c7bb46a (1 revision) (flutter/flutter#133563) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 0625049b5ee3 to d84763e04496 (6 revisions) (flutter/flutter#133559) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from c2ec683c4ea8 to 0625049b5ee3 (2 revisions) (flutter/flutter#133538) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 3d1faae1bc2f to c2ec683c4ea8 (4 revisions) (flutter/flutter#133535) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from c7c61ff9732c to 3d1faae1bc2f (1 revision) (flutter/flutter#133530) 2023-08-29 dnfield@google.com Fix bug in setPreferredOrientations example (flutter/flutter#133503) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 9778c2cb1d51 to c7c61ff9732c (2 revisions) (flutter/flutter#133527) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from ffda7e3cfc7f to 9778c2cb1d51 (1 revision) (flutter/flutter#133526) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 1e821961e96a to ffda7e3cfc7f (2 revisions) (flutter/flutter#133523) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from 45e2b41e5ae5 to 1e821961e96a (2 revisions) (flutter/flutter#133520) 2023-08-29 engine-flutter-autoroll@skia.org Roll Flutter Engine from bd2132a0814f to 45e2b41e5ae5 (2 revisions) (flutter/flutter#133518) 2023-08-29 flar@google.com add missing forwards of local-engine-host in benchmark runners (flutter/flutter#133517) 2023-08-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from a7a4c1c70bad to bd2132a0814f (3 revisions) (flutter/flutter#133516) 2023-08-28 polinach@google.com FocusNode and FocusManager should dispatch creation in constructor. (flutter/flutter#133490) 2023-08-28 gspencergoog@users.noreply.github.com Use flutter pub get instead of dart pub get in create_api_docs.dart (flutter/flutter#133493) 2023-08-28 polinach@google.com PlatformRouteInformationProvider should dispatch creation in constructor. (flutter/flutter#133492) 2023-08-28 engine-flutter-autoroll@skia.org Roll Flutter Engine from 91522a188bda to a7a4c1c70bad (11 revisions) (flutter/flutter#133508) 2023-08-28 zanderso@users.noreply.github.com Revert "Remove `ImageProvider.load`, `DecoderCallback` and `PaintingB� (flutter/flutter#133482) 2023-08-28 rmolivares@renzo-olivares.dev Fix context menu button color on Android when textButtonTheme is set (flutter/flutter#133271) 2023-08-28 49699333+dependabot[bot]@users.noreply.github.com Bump github/codeql-action from 2.21.4 to 2.21.5 (flutter/flutter#133504) 2023-08-28 tessertaha@gmail.com Fix `DatePickerDialog` & `DateRangePickerDialog` overflow when resized from landscape to portrait (flutter/flutter#133327) 2023-08-28 15619084+vashworth@users.noreply.github.com Empty commit to re-trigger tests (flutter/flutter#133495) 2023-08-28 15619084+vashworth@users.noreply.github.com Revert "PlatformRouteInformationProvider should dispatch creation in constructor." (flutter/flutter#133479) 2023-08-28 15619084+vashworth@users.noreply.github.com Revert "FocusNode and FocusManager should dispatch creation in constructor." (flutter/flutter#133474) If this roll has caused a breakage, revert this CL and stop the roller using the controls here: https://autoroll.skia.org/r/flutter-packages Please CC rmistry@google.com,stuartmorgan@google.com on the revert to ensure that a human is aware of the problem. To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose To report a problem with the AutoRoller itself, please file a bug: https://bugs.chromium.org/p/skia/issues/entry?template=Autoroller+Bug Documentation for the AutoRoller is here: https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
The
ui.Displayis a simple data class (likeMediaQueryData), and does not get updated when the display size changes. The provided sample code does not work as intended, but the update does.