Tooltip assertion error when using FlutterEasyDialogs.builder() in MaterialApp.router
Description
When using FlutterEasyDialogs.builder() as the builder parameter in MaterialApp.router, an assertion error is thrown when trying to select text in a TextFormField. The error prevents the text selection overlay menu (copy, paste, select all, etc.) from appearing.
Steps to Reproduce
Set up a Flutter project using MaterialApp.router
Add FlutterEasyDialogs.builder() as the builder parameter:
MaterialApp.router(
builder: FlutterEasyDialogs.builder(),
// other parameters...
)
Include a TextFormField in your widget tree
Attempt to select text in the TextFormField
Expected Behavior
The text selection overlay menu should appear when selecting text in the TextFormField.
Actual Behavior
An assertion error is thrown, and the text selection overlay menu does not appear.
Error Message
The following assertion was thrown building Tooltip("More", dirty, dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#5e000]], state: TooltipState#417a7):
No Overlay widget found.
Tooltip widgets require an Overlay widget ancestor within the closest LookupBoundary.
An overlay lets widgets float on top of other widget children.
To introduce an Overlay widget, you can either directly include one, or use a widget that contains an Overlay itself, such as a Navigator, WidgetApp, MaterialApp, or CupertinoApp.
The specific widget that could not find a Overlay ancestor was: Tooltip
Additional Information
Flutter version: 3.22.3
FlutterEasyDialogs version: 4.0.1
Device/Emulator: Xiaomi Redmi Note 11 Pro
OS: Android / MacOS with VSCode
Workaround
Removing the builder: FlutterEasyDialogs.builder() from MaterialApp.router resolves the issue, but this is not a viable solution as it removes the desired functionality of FlutterEasyDialogs.
Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v):
[✓] Flutter (Channel stable, 3.22.3, on macOS 15.0 24A335 darwin-arm64, locale en-ID)
[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
[✓] Xcode - develop for iOS and macOS (Xcode 16.0)
[✓] Chrome - develop for the web
[✓] Android Studio (version 2024.1)
[✓] VS Code (version 1.93.1)
[✓] Connected device (5 available)
[✓] Network resources
• No issues found!
Relevant log output
════════ Exception caught by widgets library ═══════════════════════════════════
The following assertion was thrown building Tooltip("More", dirty, dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#5e000]], state: TooltipState#417a7):
No Overlay widget found.
Tooltip widgets require an Overlay widget ancestor within the closest LookupBoundary.
An overlay lets widgets float on top of other widget children.
To introduce an Overlay widget, you can either directly include one, or use a widget that contains an Overlay itself, such as a Navigator, WidgetApp, MaterialApp, or CupertinoApp.
The specific widget that could not find a Overlay ancestor was: Tooltip
"More"
dirty
dependencies: [_InheritedTheme, _LocalizationsScope-[GlobalKey#5e000]]
state: TooltipState#417a7
Code of Conduct
[X] I agree to follow this project's Code of Conduct
What happened?
Tooltip assertion error when using FlutterEasyDialogs.builder() in MaterialApp.router
Description
When using
FlutterEasyDialogs.builder()
as thebuilder
parameter inMaterialApp.router
, an assertion error is thrown when trying to select text in a TextFormField. The error prevents the text selection overlay menu (copy, paste, select all, etc.) from appearing.Steps to Reproduce
Expected Behavior
The text selection overlay menu should appear when selecting text in the TextFormField.
Actual Behavior
An assertion error is thrown, and the text selection overlay menu does not appear.
Error Message
Additional Information
Workaround
Removing the
builder: FlutterEasyDialogs.builder()
from MaterialApp.router resolves the issue, but this is not a viable solution as it removes the desired functionality of FlutterEasyDialogs.Flutter Doctor
Doctor summary (to see all details, run flutter doctor -v): [✓] Flutter (Channel stable, 3.22.3, on macOS 15.0 24A335 darwin-arm64, locale en-ID) [✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0) [✓] Xcode - develop for iOS and macOS (Xcode 16.0) [✓] Chrome - develop for the web [✓] Android Studio (version 2024.1) [✓] VS Code (version 1.93.1) [✓] Connected device (5 available) [✓] Network resources
• No issues found!
Relevant log output
Code of Conduct