Enhance error handling of WidgetsBindingObserver callbacks#181174
Conversation
There was a problem hiding this comment.
Code Review
This pull request enhances error handling in WidgetsBindingObserver callbacks by wrapping them in try-catch blocks. This is a valuable improvement as it prevents exceptions in one observer from affecting others and ensures errors are reported. The changes are accompanied by good test coverage.
My main feedback is regarding the significant code duplication introduced by the new try-catch blocks. I've suggested refactoring this logic into a helper method to improve code maintainability and reduce redundancy. This would make the code cleaner and easier to manage in the future.
| void handleMetricsChanged() { | ||
| super.handleMetricsChanged(); | ||
| for (final observer in List<WidgetsBindingObserver>.of(_observers)) { | ||
| observer.didChangeMetrics(); | ||
| try { | ||
| observer.didChangeMetrics(); | ||
| } catch (exception, stack) { | ||
| FlutterError.reportError( | ||
| FlutterErrorDetails( | ||
| exception: exception, | ||
| stack: stack, | ||
| library: 'widgets library', | ||
| context: ErrorDescription('while dispatching notifications for WidgetsBindingObserver.didChangeMetrics'), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| void handleTextScaleFactorChanged() { | ||
| super.handleTextScaleFactorChanged(); | ||
| for (final observer in List<WidgetsBindingObserver>.of(_observers)) { | ||
| observer.didChangeTextScaleFactor(); | ||
| try { | ||
| observer.didChangeTextScaleFactor(); | ||
| } catch (exception, stack) { | ||
| FlutterError.reportError( | ||
| FlutterErrorDetails( | ||
| exception: exception, | ||
| stack: stack, | ||
| library: 'widgets library', | ||
| context: ErrorDescription('while dispatching notifications for WidgetsBindingObserver.didChangeTextScaleFactor'), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| void handlePlatformBrightnessChanged() { | ||
| super.handlePlatformBrightnessChanged(); | ||
| for (final observer in List<WidgetsBindingObserver>.of(_observers)) { | ||
| observer.didChangePlatformBrightness(); | ||
| try { | ||
| observer.didChangePlatformBrightness(); | ||
| } catch (exception, stack) { | ||
| FlutterError.reportError( | ||
| FlutterErrorDetails( | ||
| exception: exception, | ||
| stack: stack, | ||
| library: 'widgets library', | ||
| context: ErrorDescription('while dispatching notifications for WidgetsBindingObserver.didChangePlatformBrightness'), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
| } | ||
|
|
||
| @override | ||
| void handleAccessibilityFeaturesChanged() { | ||
| super.handleAccessibilityFeaturesChanged(); | ||
| for (final observer in List<WidgetsBindingObserver>.of(_observers)) { | ||
| observer.didChangeAccessibilityFeatures(); | ||
| try { | ||
| observer.didChangeAccessibilityFeatures(); | ||
| } catch (exception, stack) { | ||
| FlutterError.reportError( | ||
| FlutterErrorDetails( | ||
| exception: exception, | ||
| stack: stack, | ||
| library: 'widgets library', | ||
| context: ErrorDescription('while dispatching notifications for WidgetsBindingObserver.didChangeAccessibilityFeatures'), | ||
| ), | ||
| ); | ||
| } | ||
| } | ||
| } |
There was a problem hiding this comment.
This pull request introduces a significant amount of duplicated code for error handling across multiple methods. To improve maintainability and reduce redundancy, consider extracting the common try-catch logic into a helper method. This aligns with the style guide's principle of optimizing for readability.
For example, you could introduce a private helper method like this:
void _dispatchToObservers(void Function(WidgetsBindingObserver) callback, String context) {
for (final WidgetsBindingObserver observer in List<WidgetsBindingObserver>.of(_observers)) {
try {
callback(observer);
} catch (exception, stack) {
FlutterError.reportError(FlutterErrorDetails(
exception: exception,
stack: stack,
library: 'widgets library',
context: ErrorDescription('while dispatching notifications for $context'),
));
}
}
}Then, you can refactor methods like handleMetricsChanged to be more concise:
void handleMetricsChanged() {
super.handleMetricsChanged();
_dispatchToObservers(
(WidgetsBindingObserver observer) => observer.didChangeMetrics(),
'WidgetsBindingObserver.didChangeMetrics',
);
}This approach can be applied to all synchronous observer notifications, significantly cleaning up the code. A similar pattern could be used for methods iterating over _backGestureObservers. While async methods are more complex, they might also benefit from a similar refactoring strategy.
References
- The style guide (line 29) emphasizes optimizing for readability. Extracting the duplicated
try-catchlogic into a helper method would make the code more readable and maintainable by reducing redundancy. (link)
There was a problem hiding this comment.
I think this is no big deal, either way.
Wraps all 16 WidgetsBindingObserver callback invocations in try-catch blocks to prevent silent failures and ensure all observers are notified even when one throws an exception. Previously, exceptions in observer callbacks would either: - Be silently discarded (method channel handlers) - Prevent subsequent observers from being notified Now, exceptions are properly reported via FlutterError.reportError and all observers continue to receive notifications. Fixes flutter#180434
f239bbf to
676dd58
Compare
Piinks
left a comment
There was a problem hiding this comment.
Thanks for the PR! This is great!
| }; | ||
|
|
||
| // Create observers: one that throws, one that should still get called | ||
| final throwingObserver = ThrowingObserver(); |
| WidgetsBinding.instance.addObserver(throwingObserver); | ||
| WidgetsBinding.instance.addObserver(loggingObserver); | ||
|
|
||
| // Test regular callback (didChangeAppLifecycleState) |
There was a problem hiding this comment.
Can you add to this test so that all of the callbacks are covered?
There was a problem hiding this comment.
Yes. Let me do it.
I will extended tests with rest of the callbacks and refactored overall test structure.
|
@Piinks I updated the code. Can you review it again? |
justinmc
left a comment
There was a problem hiding this comment.
One improvement to make with your try/catch approach in the tests, otherwise this looks good. I've noticed some error swallowing like this before. I'm glad we can report all of these now.
|
Refactored using |
|
@ksokolovskyi or @AbdeMohlbi can you put it autosubmit please 🙏 ? |
ksokolovskyi
left a comment
There was a problem hiding this comment.
LGTM, thanks for your contribution!
|
autosubmit label was removed for flutter/flutter/181174, because The base commit of the PR is older than 7 days and can not be merged. Please merge the latest changes from the main into this branch and resubmit the PR. |
Roll Flutter from da72d5936d69 to 1d9d6a9a5ef6 (33 revisions) flutter/flutter@da72d59...1d9d6a9 2026-01-30 planetmarshall@users.noreply.github.com enable enhanced debugging for GLES playground (flutter/flutter#181157) 2026-01-30 matt.kosarek@canonical.com Make the Windows windowing_test in .ci.yaml have bringup as false (flutter/flutter#181664) 2026-01-30 engine-flutter-autoroll@skia.org Roll Packages from cd4fd61 to 510dd40 (4 revisions) (flutter/flutter#181726) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from edbf7e9eb846 to 4745eb2fe837 (1 revision) (flutter/flutter#181725) 2026-01-30 kazbek.sultanov.doc@gmail.com Enhance error handling of WidgetsBindingObserver callbacks (flutter/flutter#181174) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from 05d3cb9d2be9 to edbf7e9eb846 (2 revisions) (flutter/flutter#181715) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from c198e5fa9cd9 to 05d3cb9d2be9 (1 revision) (flutter/flutter#181712) 2026-01-30 engine-flutter-autoroll@skia.org Roll Dart SDK from 920b7e24583e to 2703fd9733ce (2 revisions) (flutter/flutter#181693) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from b9f40c193e7a to c198e5fa9cd9 (6 revisions) (flutter/flutter#181692) 2026-01-30 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#181690) 2026-01-30 jason-simmons@users.noreply.github.com Extend the Windows tool_integration_tests_2_9 shard timeout to 1 hour (flutter/flutter#181678) 2026-01-29 34871572+gmackall@users.noreply.github.com Add `android_sdk` dependency to `android_engine_opengles_tests` (flutter/flutter#181681) 2026-01-29 engine-flutter-autoroll@skia.org Roll Dart SDK from a0685c8e946b to 920b7e24583e (3 revisions) (flutter/flutter#181680) 2026-01-29 engine-flutter-autoroll@skia.org Roll Skia from 128b5213711e to b9f40c193e7a (14 revisions) (flutter/flutter#181675) 2026-01-29 jason-simmons@users.noreply.github.com [Impeller] Ensure that HostBuffers/DeviceBuffers allocated by RendererTest tests are valid for the lifetime of the RenderPass (flutter/flutter#181635) 2026-01-29 jason-simmons@users.noreply.github.com [Impeller] Fix off-by-one indices in the SimilarPointPair/SimilarPointTrio functions used by ShadowPathGeometryTest (flutter/flutter#181623) 2026-01-29 anishtiwari5077@gmail.com 180162 fix radio list tile and switch list tile accept widget states controller (flutter/flutter#180367) 2026-01-29 116356835+AbdeMohlbi@users.noreply.github.com Remove unused test file (flutter/flutter#181671) 2026-01-29 jason-simmons@users.noreply.github.com Roll libpng to version 1.6.54 (flutter/flutter#181625) 2026-01-29 34871572+gmackall@users.noreply.github.com Remove nonstandard ndkpath for `hybrid_android_views` integration test (flutter/flutter#181666) 2026-01-29 34465683+rkishan516@users.noreply.github.com Add TestWidgetsApp utility and refactor widget tests to use WidgetsApp (flutter/flutter#180456) 2026-01-29 rmolivares@renzo-olivares.dev Add `TestTextField` and migrate tests (flutter/flutter#180494) 2026-01-29 jacksongardner@google.com Merge changelog for 3.38.9 (flutter/flutter#181668) 2026-01-29 dacoharkes@google.com [flutter_tools] Deprecate `plugin_ffi` template (flutter/flutter#181588) 2026-01-29 brackenavaron@gmail.com Deprecate onReorder callback (flutter/flutter#178242) 2026-01-29 zhongliu88889@gmail.com [web] Use defensive null check in text editing placeElement (flutter/flutter#180795) 2026-01-29 engine-flutter-autoroll@skia.org Roll Packages from 1cb2148 to cd4fd61 (4 revisions) (flutter/flutter#181663) 2026-01-29 engine-flutter-autoroll@skia.org Roll Skia from 89df65f8324c to 128b5213711e (2 revisions) (flutter/flutter#181651) 2026-01-29 dacoharkes@google.com [hooks] Don't run build hooks for code assets in `flutter run` (flutter/flutter#181542) 2026-01-29 engine-flutter-autoroll@skia.org Roll Dart SDK from f10dcbfca98f to a0685c8e946b (5 revisions) (flutter/flutter#181653) 2026-01-29 evanwall@buffalo.edu Fixes getUniformX for Vulkan (flutter/flutter#181286) 2026-01-29 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from adhoq9ouVRh0xzkm3... to isy1ARvK-3bsvtfc-... (flutter/flutter#181641) 2026-01-29 dmytro@turskyi.com Add isDark, isLight, and isSystem getters to ThemeMode (flutter/flutter#181475) 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 bmparr@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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: ...
…81174) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> Wraps all 16 WidgetsBindingObserver callback invocations in try-catch blocks to prevent silent failures and ensure all observers are notified even when one throws an exception. Previously, exceptions in observer callbacks would either: - Be silently discarded (method channel handlers) - Prevent subsequent observers from being notified Now, exceptions are properly reported via FlutterError.reportError and all observers continue to receive notifications. Fixes flutter#180434 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md [](https://www.talabat.com) [](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests) --------- Co-authored-by: Mohellebi Abdessalem <116356835+AbdeMohlbi@users.noreply.github.com>
…81174) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> Wraps all 16 WidgetsBindingObserver callback invocations in try-catch blocks to prevent silent failures and ensure all observers are notified even when one throws an exception. Previously, exceptions in observer callbacks would either: - Be silently discarded (method channel handlers) - Prevent subsequent observers from being notified Now, exceptions are properly reported via FlutterError.reportError and all observers continue to receive notifications. Fixes flutter#180434 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md [](https://www.talabat.com) [](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests) --------- Co-authored-by: Mohellebi Abdessalem <116356835+AbdeMohlbi@users.noreply.github.com>
…81174) <!-- Thanks for filing a pull request! Reviewers are typically assigned within a week of filing a request. To learn more about code review, see our documentation on Tree Hygiene: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md --> Wraps all 16 WidgetsBindingObserver callback invocations in try-catch blocks to prevent silent failures and ensure all observers are notified even when one throws an exception. Previously, exceptions in observer callbacks would either: - Be silently discarded (method channel handlers) - Prevent subsequent observers from being notified Now, exceptions are properly reported via FlutterError.reportError and all observers continue to receive notifications. Fixes flutter#180434 ## Pre-launch Checklist - [x] I read the [Contributor Guide] and followed the process outlined there for submitting PRs. - [x] I read the [Tree Hygiene] wiki page, which explains my responsibilities. - [x] I read and followed the [Flutter Style Guide], including [Features we expect every widget to implement]. - [x] I signed the [CLA]. - [x] I listed at least one issue that this PR fixes in the description above. - [x] I updated/added relevant documentation (doc comments with `///`). - [x] I added new tests to check the change I am making, or this PR is [test-exempt]. - [x] I followed the [breaking change policy] and added [Data Driven Fixes] where supported. - [x] All existing and new tests are passing. If you need help, consider asking for advice on the #hackers-new channel on [Discord]. **Note**: The Flutter team is currently trialing the use of [Gemini Code Assist for GitHub](https://developers.google.com/gemini-code-assist/docs/review-github-code). Comments from the `gemini-code-assist` bot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed. <!-- Links --> [Contributor Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#overview [Tree Hygiene]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md [test-exempt]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#tests [Flutter Style Guide]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md [Features we expect every widget to implement]: https://github.com/flutter/flutter/blob/main/docs/contributing/Style-guide-for-Flutter-repo.md#features-we-expect-every-widget-to-implement [CLA]: https://cla.developers.google.com/ [flutter/tests]: https://github.com/flutter/tests [breaking change policy]: https://github.com/flutter/flutter/blob/main/docs/contributing/Tree-hygiene.md#handling-breaking-changes [Discord]: https://github.com/flutter/flutter/blob/main/docs/contributing/Chat.md [Data Driven Fixes]: https://github.com/flutter/flutter/blob/main/docs/contributing/Data-driven-Fixes.md [](https://www.talabat.com) [](https://github.com/search?q=org%3Aflutter+talabat&type=pullrequests) --------- Co-authored-by: Mohellebi Abdessalem <116356835+AbdeMohlbi@users.noreply.github.com>
…r#10931) Roll Flutter from da72d5936d69 to 1d9d6a9a5ef6 (33 revisions) flutter/flutter@da72d59...1d9d6a9 2026-01-30 planetmarshall@users.noreply.github.com enable enhanced debugging for GLES playground (flutter/flutter#181157) 2026-01-30 matt.kosarek@canonical.com Make the Windows windowing_test in .ci.yaml have bringup as false (flutter/flutter#181664) 2026-01-30 engine-flutter-autoroll@skia.org Roll Packages from cd4fd61 to 510dd40 (4 revisions) (flutter/flutter#181726) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from edbf7e9eb846 to 4745eb2fe837 (1 revision) (flutter/flutter#181725) 2026-01-30 kazbek.sultanov.doc@gmail.com Enhance error handling of WidgetsBindingObserver callbacks (flutter/flutter#181174) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from 05d3cb9d2be9 to edbf7e9eb846 (2 revisions) (flutter/flutter#181715) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from c198e5fa9cd9 to 05d3cb9d2be9 (1 revision) (flutter/flutter#181712) 2026-01-30 engine-flutter-autoroll@skia.org Roll Dart SDK from 920b7e24583e to 2703fd9733ce (2 revisions) (flutter/flutter#181693) 2026-01-30 engine-flutter-autoroll@skia.org Roll Skia from b9f40c193e7a to c198e5fa9cd9 (6 revisions) (flutter/flutter#181692) 2026-01-30 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#181690) 2026-01-30 jason-simmons@users.noreply.github.com Extend the Windows tool_integration_tests_2_9 shard timeout to 1 hour (flutter/flutter#181678) 2026-01-29 34871572+gmackall@users.noreply.github.com Add `android_sdk` dependency to `android_engine_opengles_tests` (flutter/flutter#181681) 2026-01-29 engine-flutter-autoroll@skia.org Roll Dart SDK from a0685c8e946b to 920b7e24583e (3 revisions) (flutter/flutter#181680) 2026-01-29 engine-flutter-autoroll@skia.org Roll Skia from 128b5213711e to b9f40c193e7a (14 revisions) (flutter/flutter#181675) 2026-01-29 jason-simmons@users.noreply.github.com [Impeller] Ensure that HostBuffers/DeviceBuffers allocated by RendererTest tests are valid for the lifetime of the RenderPass (flutter/flutter#181635) 2026-01-29 jason-simmons@users.noreply.github.com [Impeller] Fix off-by-one indices in the SimilarPointPair/SimilarPointTrio functions used by ShadowPathGeometryTest (flutter/flutter#181623) 2026-01-29 anishtiwari5077@gmail.com 180162 fix radio list tile and switch list tile accept widget states controller (flutter/flutter#180367) 2026-01-29 116356835+AbdeMohlbi@users.noreply.github.com Remove unused test file (flutter/flutter#181671) 2026-01-29 jason-simmons@users.noreply.github.com Roll libpng to version 1.6.54 (flutter/flutter#181625) 2026-01-29 34871572+gmackall@users.noreply.github.com Remove nonstandard ndkpath for `hybrid_android_views` integration test (flutter/flutter#181666) 2026-01-29 34465683+rkishan516@users.noreply.github.com Add TestWidgetsApp utility and refactor widget tests to use WidgetsApp (flutter/flutter#180456) 2026-01-29 rmolivares@renzo-olivares.dev Add `TestTextField` and migrate tests (flutter/flutter#180494) 2026-01-29 jacksongardner@google.com Merge changelog for 3.38.9 (flutter/flutter#181668) 2026-01-29 dacoharkes@google.com [flutter_tools] Deprecate `plugin_ffi` template (flutter/flutter#181588) 2026-01-29 brackenavaron@gmail.com Deprecate onReorder callback (flutter/flutter#178242) 2026-01-29 zhongliu88889@gmail.com [web] Use defensive null check in text editing placeElement (flutter/flutter#180795) 2026-01-29 engine-flutter-autoroll@skia.org Roll Packages from 1cb2148 to cd4fd61 (4 revisions) (flutter/flutter#181663) 2026-01-29 engine-flutter-autoroll@skia.org Roll Skia from 89df65f8324c to 128b5213711e (2 revisions) (flutter/flutter#181651) 2026-01-29 dacoharkes@google.com [hooks] Don't run build hooks for code assets in `flutter run` (flutter/flutter#181542) 2026-01-29 engine-flutter-autoroll@skia.org Roll Dart SDK from f10dcbfca98f to a0685c8e946b (5 revisions) (flutter/flutter#181653) 2026-01-29 evanwall@buffalo.edu Fixes getUniformX for Vulkan (flutter/flutter#181286) 2026-01-29 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from adhoq9ouVRh0xzkm3... to isy1ARvK-3bsvtfc-... (flutter/flutter#181641) 2026-01-29 dmytro@turskyi.com Add isDark, isLight, and isSystem getters to ThemeMode (flutter/flutter#181475) 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 bmparr@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://issues.skia.org/issues/new?component=1389291&template=1850622 Documentation for the AutoRoller is here: ...
Wraps all 16 WidgetsBindingObserver callback invocations in try-catch blocks to prevent silent failures and ensure all observers are notified even when one throws an exception.
Previously, exceptions in observer callbacks would either:
Now, exceptions are properly reported via FlutterError.reportError and all observers continue to receive notifications.
Fixes #180434
Pre-launch Checklist
///).If you need help, consider asking for advice on the #hackers-new channel on Discord.
Note: The Flutter team is currently trialing the use of Gemini Code Assist for GitHub. Comments from the
gemini-code-assistbot should not be taken as authoritative feedback from the Flutter team. If you find its comments useful you can update your code accordingly, but if you are unsure or disagree with the feedback, please feel free to wait for a Flutter team member's review for guidance on which automated comments should be addressed.