Skip to content
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

merging version check #1

Merged
merged 8 commits into from
Aug 22, 2022
Merged

Conversation

eliasyishak
Copy link
Owner

Replace this paragraph with a description of what this PR is changing or adding, and why. Consider including before/after screenshots.

List which issues are fixed by this PR. You must list at least one issue.

If you had to change anything in the flutter/tests repo, include a link to the migration guide as per the breaking change policy.

Pre-launch Checklist

  • I read the Contributor Guide and followed the process outlined there for submitting PRs.
  • I read the Tree Hygiene wiki page, which explains my responsibilities.
  • I read and followed the Flutter Style Guide, including Features we expect every widget to implement.
  • I signed the CLA.
  • I listed at least one issue that this PR fixes in the description above.
  • I updated/added relevant documentation (doc comments with ///).
  • I added new tests to check the change I am making, or this PR is test-exempt.
  • All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel on Discord.

Sorry, something went wrong.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
@eliasyishak eliasyishak merged commit 2b9d07b into windows-version-check-in-doctor Aug 22, 2022
eliasyishak pushed a commit that referenced this pull request Jun 6, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
…extMenuBuilder (flutter#128114)

Close flutter#128113 

Fun fact: This is caught by monkey testing I have written (will soon be open sourced as well) that runs on my app!

Without the fix, the test fails as expected:

<details>

```
(base) �  flutter git:(feat/text-field-npe) /Volumes/MyExternal/ExternalRefCode/flutter/bin/flutter test test/material/text_field_test.dart --name 'changes from default'
00:06 +0: context menu contextMenuBuilder changes from default to null                                                                
��� EXCEPTION CAUGHT BY WIDGETS LIBRARY ������������������������������������������������������������
The following _TypeError was thrown building
_OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#e3717](state:
_OverlayEntryWidgetState#7666a):
Null check operator used on a null value

When the exception was thrown, this was the stack:
#0      EditableTextState._createSelectionOverlay.<anonymous closure> (package:flutter/src/widgets/editable_text.dart:3331:43)
#1      SelectionOverlay.showToolbar.<anonymous closure> (package:flutter/src/widgets/text_selection.dart:1357:36)
#2      ContextMenuController.show.<anonymous closure> (package:flutter/src/widgets/context_menu_controller.dart:65:54)
#3      _OverlayEntryWidgetState.build (package:flutter/src/widgets/overlay.dart:351:36)
#4      StatefulElement.build (package:flutter/src/widgets/framework.dart:5198:27)
#5      ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5086:15)
#6      StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
#7      Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
#8      StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
#9      Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
#10     RenderObjectElement.updateChildren (package:flutter/src/widgets/framework.dart:6093:32)
#11     MultiChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6595:17)
flutter#12     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#13     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#14     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#15     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#16     StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#17     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#18     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#19     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#20     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#21     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#22     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#23     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#24     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#25     _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#26     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#27     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#28     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#29     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#30     StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#31     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#32     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#33     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#34     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#35     _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#36     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#37     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#38     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#39     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#40     StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#41     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#42     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#43     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#44     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#45     StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#46     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#47     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#48     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#49     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#50     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#51     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#52     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#53     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#54     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#55     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#56     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#57     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#58     StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#59     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#60     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#61     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#62     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#63     _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#64     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#65     SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#66     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#67     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#68     StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#69     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#70     StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#71     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#72     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#73     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#74     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#75     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#76     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#77     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#78     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#79     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#80     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#81     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#82     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#83     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#84     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#85     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#86     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#87     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#88     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#89     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#90     StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#91     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#92     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#93     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#94     ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#95     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#96     ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#97     Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#98     StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#99     Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#100    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#101    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#102    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#103    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#104    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#105    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#106    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#107    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#108    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#109    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#110    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#111    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#112    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#113    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#114    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#115    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#116    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#117    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#118    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#119    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#120    StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#121    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#122    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#123    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#124    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#125    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#126    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#127    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#128    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#129    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#130    StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#131    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#132    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#133    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#134    StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#135    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#136    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#137    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#138    StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#139    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#140    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#141    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#142    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#143    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#144    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#145    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#146    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#147    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#148    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#149    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#150    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#151    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#152    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#153    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#154    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#155    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#156    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#157    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#158    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#159    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#160    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#161    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#162    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#163    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#164    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#165    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#166    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#167    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#168    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#169    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#170    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#171    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#172    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#173    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#174    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#175    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#176    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#177    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#178    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#179    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#180    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#181    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#182    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#183    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#184    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#185    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#186    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#187    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#188    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#189    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#190    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#191    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#192    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#193    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#194    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#195    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#196    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#197    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#198    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#199    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#200    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#201    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#202    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#203    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#204    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#205    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#206    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#207    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#208    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#209    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#210    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#211    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#212    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#213    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#214    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#215    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#216    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#217    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#218    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#219    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#220    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#221    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#222    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#223    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#224    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#225    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#226    StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#227    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#228    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#229    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#230    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#231    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#232    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#233    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#234    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#235    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#236    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#237    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#238    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#239    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#240    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#241    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#242    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#243    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#244    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#245    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#246    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#247    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#248    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#249    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#250    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#251    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#252    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#253    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#254    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#255    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#256    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#257    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#258    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#259    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#260    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#261    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#262    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#263    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#264    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#265    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#266    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#267    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#268    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#269    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#270    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#271    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#272    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#273    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#274    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#275    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#276    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#277    SingleChildRenderObjectElement.update (package:flutter/src/widgets/framework.dart:6442:14)
flutter#278    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#279    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#280    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#281    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#282    _InheritedNotifierElement.update (package:flutter/src/widgets/inherited_notifier.dart:107:11)
flutter#283    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#284    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#285    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#286    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#287    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#288    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#289    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#290    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#291    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#292    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#293    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#294    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#295    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#296    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#297    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#298    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#299    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#300    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#301    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#302    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#303    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#304    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#305    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#306    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#307    StatefulElement.performRebuild (package:flutter/src/widgets/framework.dart:5251:11)
flutter#308    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#309    StatefulElement.update (package:flutter/src/widgets/framework.dart:5274:5)
flutter#310    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#311    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#312    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#313    ProxyElement.update (package:flutter/src/widgets/framework.dart:5417:5)
flutter#314    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#315    ComponentElement.performRebuild (package:flutter/src/widgets/framework.dart:5111:16)
flutter#316    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#317    StatelessElement.update (package:flutter/src/widgets/framework.dart:5162:5)
flutter#318    Element.updateChild (package:flutter/src/widgets/framework.dart:3686:15)
flutter#319    RenderObjectToWidgetElement._rebuild (package:flutter/src/widgets/binding.dart:1253:16)
flutter#320    RenderObjectToWidgetElement.update (package:flutter/src/widgets/binding.dart:1230:5)
flutter#321    RenderObjectToWidgetElement.performRebuild (package:flutter/src/widgets/binding.dart:1244:7)
flutter#322    Element.rebuild (package:flutter/src/widgets/framework.dart:4805:7)
flutter#323    BuildOwner.buildScope (package:flutter/src/widgets/framework.dart:2780:19)
flutter#324    AutomatedTestWidgetsFlutterBinding.drawFrame (package:flutter_test/src/binding.dart:1396:19)
flutter#325    RendererBinding._handlePersistentFrameCallback (package:flutter/src/rendering/binding.dart:358:5)
flutter#326    SchedulerBinding._invokeFrameCallback (package:flutter/src/scheduler/binding.dart:1297:15)
flutter#327    SchedulerBinding.handleDrawFrame (package:flutter/src/scheduler/binding.dart:1227:9)
flutter#328    AutomatedTestWidgetsFlutterBinding.pump.<anonymous closure> (package:flutter_test/src/binding.dart:1246:9)
flutter#331    TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:68:41)
flutter#332    AutomatedTestWidgetsFlutterBinding.pump (package:flutter_test/src/binding.dart:1232:27)
flutter#333    WidgetTester._pumpWidget (package:flutter_test/src/widget_tester.dart:587:20)
flutter#334    WidgetTester.pumpWidget.<anonymous closure> (package:flutter_test/src/widget_tester.dart:572:14)
flutter#337    TestAsyncUtils.guard (package:flutter_test/src/test_async_utils.dart:68:41)
flutter#338    WidgetTester.pumpWidget (package:flutter_test/src/widget_tester.dart:571:27)
flutter#339    main.<anonymous closure>.<anonymous closure> (file:///Volumes/MyExternal/ExternalRefCode/flutter/packages/flutter/test/material/text_field_test.dart:15687:20)
<asynchronous suspension>
<asynchronous suspension>
(elided 5 frames from dart:async and package:stack_trace)

����������������������������������������������������������������������������������������������������
00:06 +0 -1: context menu contextMenuBuilder changes from default to null [E]                                                         
  Test failed. See exception logs above.
  The test description was: contextMenuBuilder changes from default to null
  
To run this test again: /Volumes/MyExternal/ExternalRefCode/flutter/bin/cache/dart-sdk/bin/dart test /Volumes/MyExternal/ExternalRefCode/flutter/packages/flutter/test/material/text_field_test.dart -p vm --plain-name 'context menu contextMenuBuilder changes from default to null'
00:06 +0 -1: Some tests failed.                                                                                                       
(base) �  flutter git:(feat/text-field-npe) 

```

</details>
eliasyishak pushed a commit that referenced this pull request Aug 7, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
This is a follow up to the following pull requests:
- flutter#124514

I was finally able to reproduce this bug and found out why it was happening. Consider this code:

```dart
GestureDetector(
  behavior: HitTestBehavior.translucent,
  // Note: Make sure onTap is not null to ensure events
  // are captured by `GestureDetector`
  onTap: () {},
  child: _shouldShowSlider
    ? Slider(value: _value, onChanged: _handleSlide)
    : const SizedBox.shrink().
)
```

Runtime exception happens when:

1. User taps and holds the Slider (drag callback captured by `GestureDetector`)
2. `_shouldShowSlider` changes to false, Slider disappears and unmounts, and unregisters `_handleSlide`. But the callback is still registered by `GestureDetector`
3. Users moves finger as if Slider were still there
4. Drag callback is invoked, `_SliderState.showValueIndicator` is called
5. Exception - Slider is already disposed

This pull request fixes it by adding a mounted check inside `_SliderState.showValueIndicator` to ensure the Slider is actually mounted at the time of invoking drag event callback. I've added a unit test that will fail without this change.

The error stack trace is:

```
The following assertion was thrown while handling a gesture:
This widget has been unmounted, so the State no longer has a context (and should be considered
defunct).
Consider canceling any active work during "dispose" or using the "mounted" getter to determine if
the State is still active.

When the exception was thrown, this was the stack:
#0      State.context.<anonymous closure> (package:flutter/src/widgets/framework.dart:950:9)
#1      State.context (package:flutter/src/widgets/framework.dart:956:6)
#2      _SliderState.showValueIndicator (package:flutter/src/material/slider.dart:968:18)
#3      _RenderSlider._startInteraction (package:flutter/src/material/slider.dart:1487:12)
#4      _RenderSlider._handleDragStart (package:flutter/src/material/slider.dart:1541:5)
#5      DragGestureRecognizer._checkStart.<anonymous closure> (package:flutter/src/gestures/monodrag.dart:531:53)
#6      GestureRecognizer.invokeCallback (package:flutter/src/gestures/recognizer.dart:275:24)
#7      DragGestureRecognizer._checkStart (package:flutter/src/gestures/monodrag.dart:531:7)
#8      DragGestureRecognizer._checkDrag (package:flutter/src/gestures/monodrag.dart:498:5)
#9      DragGestureRecognizer.acceptGesture (package:flutter/src/gestures/monodrag.dart:431:7)
#10     _CombiningGestureArenaMember.acceptGesture (package:flutter/src/gestures/team.dart:45:14)
#11     GestureArenaManager._resolveInFavorOf (package:flutter/src/gestures/arena.dart:281:12)
flutter#12     GestureArenaManager._resolve (package:flutter/src/gestures/arena.dart:239:9)
flutter#13     GestureArenaEntry.resolve (package:flutter/src/gestures/arena.dart:53:12)
flutter#14     _CombiningGestureArenaMember._resolve (package:flutter/src/gestures/team.dart:85:15)
flutter#15     _CombiningGestureArenaEntry.resolve (package:flutter/src/gestures/team.dart:19:15)
flutter#16     OneSequenceGestureRecognizer.resolve (package:flutter/src/gestures/recognizer.dart:375:13)
flutter#17     DragGestureRecognizer.handleEvent (package:flutter/src/gestures/monodrag.dart:414:13)
flutter#18     PointerRouter._dispatch (package:flutter/src/gestures/pointer_router.dart:98:12)
flutter#19     PointerRouter._dispatchEventToRoutes.<anonymous closure> (package:flutter/src/gestures/pointer_router.dart:143:9)
flutter#20     _LinkedHashMapMixin.forEach (dart:collection-patch/compact_hash.dart:625:13)
flutter#21     PointerRouter._dispatchEventToRoutes (package:flutter/src/gestures/pointer_router.dart:141:18)
flutter#22     PointerRouter.route (package:flutter/src/gestures/pointer_router.dart:127:7)
flutter#23     GestureBinding.handleEvent (package:flutter/src/gestures/binding.dart:488:19)
flutter#24     GestureBinding.dispatchEvent (package:flutter/src/gestures/binding.dart:468:22)
flutter#25     RendererBinding.dispatchEvent (package:flutter/src/rendering/binding.dart:439:11)
flutter#26     GestureBinding._handlePointerEventImmediately (package:flutter/src/gestures/binding.dart:413:7)
flutter#27     GestureBinding.handlePointerEvent (package:flutter/src/gestures/binding.dart:376:5)
flutter#28     GestureBinding._flushPointerEventQueue (package:flutter/src/gestures/binding.dart:323:7)
flutter#29     GestureBinding._handlePointerDataPacket (package:flutter/src/gestures/binding.dart:292:9)
flutter#30     _invoke1 (dart:ui/hooks.dart:186:13)
flutter#31     PlatformDispatcher._dispatchPointerDataPacket (dart:ui/platform_dispatcher.dart:433:7)
flutter#32     _dispatchPointerDataPacket (dart:ui/hooks.dart:119:31)

Handler: "onStart"
Recognizer:
  HorizontalDragGestureRecognizer#a5df2
```

*List which issues are fixed by this PR. You must list at least one issue.*

Internal bug: b/273666179, b/192329942

*If you had to change anything in the [flutter/tests] repo, include a link to the migration guide as per the [breaking change policy].*
eliasyishak pushed a commit that referenced this pull request Oct 16, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
eliasyishak pushed a commit that referenced this pull request Oct 25, 2023

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature. The key has expired.
flutter#137242)

This reverts commit d36a843
(flutter#136809)

This fails even tho golden files were approved and `golden test` pending
was cleared and green and `autosubmit` successfully merged the PR.


```console
02:42 +4618 ~5: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following SkiaException was thrown while running async test code:
Skia Gold received an unapproved image in post-submit
testing. Golden file images in flutter/flutter are triaged
in pre-submit during code review for the given PR.

Visit https://flutter-gold.skia.org/ to view and approve
the image(s), or revert the associated change. For more
information, visit the wiki:
https://github.com/flutter/flutter/wiki/Writing-a-golden-file-test-for-package:flutter

Debug information for Gold --------------------------------
stdout: Given image with hash 37275e74c51f98d7abd7f301c5c94ac1 for test
material.outlined_button.ink_sparkle.default
Expectation for test: 531f5fa74908d2e6db2b8fd86a6b8662 (positive)
Expectation for test: 683e368ff51d947a3d63c2a5f4568cf6 (positive)
Expectation for test: 749241ff0fa21595b2c6cb551fd40b68 (positive)
Expectation for test: aaf9ac1328614d6c9f4540308bc86f62 (positive)
Expectation for test: b31a50440c7dd31b10cacd9e7b5c6b86 (positive)
Expectation for test: c0a7c8c625b69ddc695a770f28abd403 (positive)
Expectation for test: f1f66ce931c2ef33ebcb699a637025a6 (positive)
Expectation for test: 2d32e34efc1d7ca4cd12965402fb76ff (positive)
Untriaged or negative image:
https://flutter-gold.skia.org/detail?grouping=name%3Dmaterial.outlined_button.ink_sparkle.default%26source_type%3Dflutter&digest=37275e74c51f98d7abd7f301c5c94ac1


stderr: Test: material.outlined_button.ink_sparkle.default FAIL


result-state.json: No result file found.

When the exception was thrown, this was the stack:
#0      SkiaGoldClient.imgtestAdd (package:flutter_goldens_client/skia_client.dart:243:7)
<asynchronous suspension>
#1      MatchesGoldenFile.matchAsync.<anonymous closure> (package:flutter_test/src/_matchers_io.dart:118:32)
<asynchronous suspension>
<asynchronous suspension>
(elided one frame from dart:async)

The exception was caught asynchronously.
════════════════════════════════════════════════════════════════════════════════════════════════════
02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works
02:42 +4618 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/outlined_button_test.dart: Material3 - OutlinedButton, OutlinedButton.icon defaults [E]
  Test failed. See exception logs above.
  The test description was: Material3 - OutlinedButton, OutlinedButton.icon defaults
  
02:42 +4619 ~5 -1: C:/b/s/w/ir/x/w/flutter/packages/flutter/test/material/menu_anchor_test.dart: Menu functions keyboard directional traversal works
```

## Pre-launch Checklist

- [ ] I read the [Contributor Guide] and followed the process outlined
there for submitting PRs.
- [ ] I read the [Tree Hygiene] wiki page, which explains my
responsibilities.
- [ ] I read and followed the [Flutter Style Guide], including [Features
we expect every widget to implement].
- [ ] I signed the [CLA].
- [ ] I listed at least one issue that this PR fixes in the description
above.
- [ ] I updated/added relevant documentation (doc comments with `///`).
- [ ] I added new tests to check the change I am making, or this PR is
[test-exempt].
- [ ] All existing and new tests are passing.

If you need help, consider asking for advice on the #hackers-new channel
on [Discord].

<!-- Links -->
[Contributor Guide]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#overview
[Tree Hygiene]: https://github.com/flutter/flutter/wiki/Tree-hygiene
[test-exempt]:
https://github.com/flutter/flutter/wiki/Tree-hygiene#tests
[Flutter Style Guide]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo
[Features we expect every widget to implement]:
https://github.com/flutter/flutter/wiki/Style-guide-for-Flutter-repo#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/wiki/Tree-hygiene#handling-breaking-changes
[Discord]: https://github.com/flutter/flutter/wiki/Chat
eliasyishak pushed a commit that referenced this pull request Mar 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
A test was failing silently because of this (see
flutter#144353 and fixed in
flutter#144709). The failure went
undetected for months. Ideally, this should have been a regular
non-silent failure. This change makes that so. `package:test` can
properly handle reported exceptions outside of test cases. With this
change, the test fails as follows:

```
00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack:
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2      _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart
00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E]
  Test failed. See exception logs above.
  The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart
  
  This test failed after it had already completed.
  Make sure to use a matching library which informs the test runner
  of pending async work.
```
eliasyishak pushed a commit that referenced this pull request Mar 14, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
…r#144706)" (flutter#144970)

Reverts: flutter#144706
Initiated by: gspencergoog
Reason for reverting: This has broken the tree because some tests are still failing post completion. This particular one looks like it might have to do with a gold image not existing.
Original PR Author: goderbauer

Reviewed By: {Piinks}

This change reverts the following previous change:
A test was failing silently because of this (see flutter#144353 and fixed in flutter#144709). The failure went undetected for months. Ideally, this should have been a regular non-silent failure. This change makes that so. `package:test` can properly handle reported exceptions outside of test cases. With this change, the test fails as follows:

```
00:03 +82: Smoke test material/color_scheme/dynamic_content_color.0.dart
══╡ EXCEPTION CAUGHT BY FLUTTER TEST FRAMEWORK ╞════════════════════════════════════════════════════
The following assertion was thrown running a test (but after the test had completed):
setState() called after dispose(): _DynamicColorExampleState#1cd37(lifecycle state: defunct, not
mounted)
This error happens if you call setState() on a State object for a widget that no longer appears in
the widget tree (e.g., whose parent widget no longer includes the widget in its build). This error
can occur when code calls setState() from a timer or an animation callback.
The preferred solution is to cancel the timer or stop listening to the animation in the dispose()
callback. Another solution is to check the "mounted" property of this object before calling
setState() to ensure the object is still in the tree.
This error might indicate a memory leak if setState() is being called because another object is
retaining a reference to this State object after it has been removed from the tree. To avoid memory
leaks, consider breaking the reference to this object during dispose().

When the exception was thrown, this was the stack:
#0      State.setState.<anonymous closure> (package:flutter/src/widgets/framework.dart:1167:9)
#1      State.setState (package:flutter/src/widgets/framework.dart:1202:6)
#2      _DynamicColorExampleState._updateImage (package:flutter_api_samples/material/color_scheme/dynamic_content_color.0.dart:191:5)
<asynchronous suspension>
════════════════════════════════════════════════════════════════════════════════════════════════════
00:03 +81 -1: Smoke test material/context_menu/context_menu_controller.0.dart
00:03 +81 -1: Smoke test material/color_scheme/dynamic_content_color.0.dart [E]
  Test failed. See exception logs above.
  The test description was: Smoke test material/color_scheme/dynamic_content_color.0.dart
  
  This test failed after it had already completed.
  Make sure to use a matching library which informs the test runner
  of pending async work.
```
andrewkolos pushed a commit that referenced this pull request Jun 27, 2024

Verified

This commit was created on GitHub.com and signed with GitHub’s verified signature.
New analyze error in an unrelated PR 
```
╔═╡ERROR #1╞════════════════════════════════════════════════════════════════════
║ /b/s/w/ir/x/w/flutter/CODEOWNERS:13: trailing U+0020 space character
╚═══════════════════════════════════════════════════════════════════════════════
```

https://logs.chromium.org/logs/flutter/buildbucket/cr-buildbucket/8744032390138579057/+/u/run_test.dart_for_analyze_shard_and_subshard_None/stdout

On this commit 

flutter@2537b49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant