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

Flutter 1.17 Error No Media Query Widget found when long pressed text field #22

Closed
michaelwh09 opened this issue May 13, 2020 · 2 comments

Comments

@michaelwh09
Copy link

Error No Media Query Widget found when long pressed text field that supposed to pop a copy-paste.
Cannot move Flutter easy loading below MaterialApp as we using onGenerateRoute and if we move below MaterialApp then in another route the loader is not showing.

Flutter/Dart Info

[√] Flutter (Channel stable, v1.17.0, on Microsoft Windows [Version 10.0.19624.1000], locale en-GB)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[!] Android Studio (not installed)
[√] VS Code (version 1.43.1)
[!] Connected device
! No devices available

════════ Exception caught by widgets library ═══════════════════════════════════════════════════════
The following assertion was thrown building _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#2a1a4](dirty, state: _OverlayEntryWidgetState#cdcca):
No MediaQuery widget found.

_OverlayEntryWidget widgets require a MediaQuery widget ancestor.
The specific widget that could not find a MediaQuery ancestor was: _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#2a1a4]
  dirty
  state: _OverlayEntryWidgetState#cdcca
The ownership chain for the affected widget is: "_OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#2a1a4] ← _Theatre ← Overlay ← Directionality ← FlutterEasyLoading ← HomeIndustryApp ← _InheritedProviderScope<DependenciesRepositories> ← RepositoryProvider<DependenciesRepositories> ← _InheritedProviderScope<AuthenticationBloc> ← InheritedProvider<AuthenticationBloc> ← ⋯"

Typically, the MediaQuery widget is introduced by the MaterialApp or WidgetsApp widget at the top of your application widget tree.

The relevant error-causing widget was: 
  FlutterEasyLoading file:///C:/ACTIVE%20DEV/ppl/post-rpl-mobile/lib/home_industry_app.dart:32:12
When the exception was thrown, this was the stack: 
#0      debugCheckHasMediaQuery.<anonymous closure> (package:flutter/src/widgets/debug.dart:215:7)
#1      debugCheckHasMediaQuery (package:flutter/src/widgets/debug.dart:227:4)
#2      _MaterialTextSelectionControls.buildToolbar (package:flutter/src/material/text_selection.dart:645:12)
#3      TextSelectionOverlay._buildToolbar (package:flutter/src/widgets/text_selection.dart:556:34)
#4      _OverlayEntryWidgetState.build (package:flutter/src/widgets/overlay.dart:177:34)
...
════════════════════════════════════════════════════════════════════════════════════════════════════
@Pandian-Natarajan
Copy link

Pandian-Natarajan commented May 13, 2020

same here @michaelwh09
#17 (comment) this helped me.

@michaelwh09
Copy link
Author

Yes that help me too, thank you. I need to wrap the FlutterEasyLoading with Material to make the text not underlined yellow.

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

No branches or pull requests

2 participants