fix: MenuFlyout TypeError on findRenderObject in sub-item hover handler#1306
Merged
fix: MenuFlyout TypeError on findRenderObject in sub-item hover handler#1306
Conversation
…andler Fix TypeError in MenuFlyout by changing `findRenderObject` (method tearoff) to `findRenderObject()!` (method call with null assertion) on line 156 of menu_flyout.dart. Added test for MenuFlyoutSubItem hover behavior and updated CHANGELOG. Co-authored-by: bdlukaa <45696119+bdlukaa@users.noreply.github.com>
Copilot
AI
changed the title
[WIP] Fix menu flyout TypeError exception
fix: MenuFlyout TypeError on findRenderObject in sub-item hover handler
Mar 5, 2026
Owner
|
/gemini review |
Contributor
There was a problem hiding this comment.
Code Review
This pull request correctly fixes a TypeError in MenuFlyout that occurred when a sub-item's hover handler was triggered. The issue was caused by referencing findRenderObject as a method tearoff instead of calling it. The fix adds the missing function call (), which resolves the runtime error. Additionally, a new widget test has been added to specifically cover this scenario, ensuring the bug is fixed and preventing future regressions. The changelog has also been updated accordingly. The changes are correct and well-implemented.
solbirn
added a commit
to owlxcorp/fluent_ui
that referenced
this pull request
Apr 28, 2026
Resolved conflicts: - pubspec.yaml: bumped to 4.15.1+1 (upstream 4.15.1 with +1 fork suffix) - menu_flyout.dart: kept upstream's findRenderObject()! null-assertion fix (PR bdlukaa#1306 - MenuFlyout TypeError on findRenderObject) - tree_view.dart: kept upstream's _children = List.of(children) initializer (PR bdlukaa#1297 - Add TreeViewController with programmatic reordering) Brings in 30 upstream commits including TreeViewController, RTL fixes for MenuFlyout/ProgressBar/NumberBox, NavigationView negative-constraint fix, TitleBar height fix, and VisualDensity-based compact sizing. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.
MenuFlyoutthrows aTypeErrorat runtime becausefindRenderObjectis referenced as a method tearoff instead of being called. Bug introduced in 838f520.()!onfindRenderObjectcall inmenu_flyout.dartline 156, matching the identical pattern on line 154MenuFlyoutSubItem, triggers sub-menu via hover, then moves mouse away to exercise the fixed code path[next]Warning
Firewall rules blocked me from connecting to one or more addresses (expand for details)
I tried to connect to the following addresses, but was blocked by firewall rules:
chrome-infra-packages.appspot.com/usr/bin/curl curl -sIL REDACTED bash 742c�� /cache(dns block)dart.dev/usr/bin/curl curl -sL -w %{http_code} REDACTED -o /dev/null(dns block)https://storage.googleapis.com/flutter_infra_release/flutter/18818009497c581ede5d8a3b8b833b81d00cebb7/dart-sdk-linux-x64.zip/usr/bin/curl curl --retry 3 --continue-at - --location --output /tmp/flutter/bin/cache/dart-sdk-linux-x64.zip REDACTED(http block)/usr/bin/curl curl -sIL REDACTED(http block)https://storage.googleapis.com/flutter_infra_release/flutter/18818009497c581ede5d8a3b8b833b81d00cebb7/linux-x64-debug/linux-x64-flutter-gtk.zip/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot precache --linux /home/REDACTED/.pub-cache/_temp/dirGZDXJG/test/_files/is_executable.sh(http block)https://storage.googleapis.com/flutter_infra_release/flutter/18818009497c581ede5d8a3b8b833b81d00cebb7/linux-x64/font-subset.zip/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get erator.early erator.late de/node/bin/chmod(http block)https://storage.googleapis.com/flutter_infra_release/flutter/18818009497c581ede5d8a3b8b833b81d00cebb7/sky_engine.zip/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get _REDACTED.sh(http block)/usr/bin/curl curl -sIL REDACTED irt --po�� vis.sh --preprocess(http block)/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get --version(http block)https://storage.googleapis.com/flutter_infra_release/flutter/e4b8dca3f1b4ede4c30371002441c88c12187ed6/dart-sdk-linux-x64.zip/usr/bin/curl curl --retry 3 --continue-at - --location --output /tmp/flutter/bin/cache/dart-sdk-linux-x64.zip REDACTED(http block)https://storage.googleapis.com/flutter_infra_release/flutter/fonts/3012db47f3130e62f7cc0beabff968a33cbec8d8/fonts.zip/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get(http block)/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get /home/REDACTED/work/_temp/runtime-logs/command.sh(http block)/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get origin REDACTED(http block)https://storage.googleapis.com/flutter_infra_release/gradle-wrapper/fd5c1f2c013565a3bea56ada6df9d2b8e96d56aa/gradle-wrapper.tgz/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get get --local hfs credential.helpebash(http block)/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart --packages=/tmp/flutter/packages/flutter_tools/.dart_tool/package_config.json /tmp/flutter/bin/cache/flutter_tools.snapshot pub get REDACTED(http block)https://storage.googleapis.com/flutter_infra_release/releases/releases_linux.json/snap/flutter/current/usr/bin/curl curl -o releases_linux.json REDACTED(http block)/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart pub --suppress-analytics get --suppress-analytics --example --directory .(http block)/tmp/flutter/bin/cache/dart-sdk/bin/dart /tmp/flutter/bin/cache/dart-sdk/bin/dart pub --suppress-analytics --color --directory . get --example(http block)https://storage.googleapis.com/flutter_infra_release/releases/stable/linux/flutter_linux_3.32.0-stable.tar.xz/usr/bin/curl curl -sL REDACTED -o flutter.tar.xz(http block)/usr/bin/curl curl -sIL REDACTED(http block)If you need me to access, download, or install something from one of these locations, you can either:
Original prompt
✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.