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

TextField Error when you double tap or longpress while using flutter_easyloading #20

Closed
Emex4gman opened this issue May 11, 2020 · 6 comments

Comments

@Emex4gman
Copy link

Describe the bug
With the new flutter update 1.17.0, anytime I double-tap or long-press the TextField, I get an error

ERROR MESSAGE
═══════ Exception caught by widgets library ═══════════════════

The following assertion was thrown building _OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#8973d](dirty, state: _OverlayEntryWidgetState#3a398):
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>#8973d]
dirty
state: _OverlayEntryWidgetState#3a398
The ownership chain for the affected widget is: "_OverlayEntryWidget-[LabeledGlobalKey<_OverlayEntryWidgetState>#8973d] ← _Theatre ← Overlay ← Directionality ← FlutterEasyLoading ← MyApp ← [root]"

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
lib\main.dart:34
When the exception was thrown, this was the stack
#0 debugCheckHasMediaQuery.
package:flutter/…/widgets/debug.dart:215
#1 debugCheckHasMediaQuery
package:flutter/…/widgets/debug.dart:227
#2 _MaterialTextSelectionControls.buildToolbar
package:flutter/…/material/text_selection.dart:645
#3 TextSelectionOverlay._buildToolbar
package:flutter/…/widgets/text_selection.dart:556
#4 _OverlayEntryWidgetState.build
package:flutter/…/widgets/overlay.dart:177
...
══════════════════════════════════════════════════════════════

═══════ Exception caught by widgets library ════════════════════════

No MediaQuery widget found.
The relevant error-causing widget was
FlutterEasyLoading
lib\main.dart:34
══════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ══════════════════════════

No MediaQuery widget found.
The relevant error-causing widget was
FlutterEasyLoading
lib\main.dart:34
══════════════════════════════════════════════════════════════

════════ Exception caught by widgets library ═════════════════════════════

No MediaQuery widget found.
The relevant error-causing widget was
FlutterEasyLoading
lib\main.dart:34
═══════════════════════════════════════════════════════════

This is my code structure

 @override
  Widget build(BuildContext context) {
    return FlutterEasyLoading(
      child: ChangeNotifierProvider<StateManagerHelper>(
        create: (context) => StateManagerHelper(),
        child: CustomMaterial(),
      ),
    );
  }

Flutter/Dart info
dell@EMEKA MINGW64 ~/VSC/FLUTTER/truthx (master)
$ flutter doctor
Doctor summary (to see all details, run flutter doctor -v):
[√] Flutter (Channel stable, v1.17.0, on Microsoft Windows [Version 10.0.17763.973], locale en-US)

[√] Android toolchain - develop for Android devices (Android SDK version 29.0.3)
[√] Android Studio (version 3.6)
[√] VS Code (version 1.45.0)
[√] Connected device (1 available)

• No issues found!

Screenshots
If applicable, add screenshots to help explain your problem.

WhatsApp Image 2020-05-11 at 10 22 10 AM

@giapvokt
Copy link

I got the same issue when I upgrade flutter to 1.17.0

@giapvokt
Copy link

@Emex4gman I just follow this comment and it resolved the issue #17 (comment)

@Emex4gman
Copy link
Author

Thanks @giapvokt you a life saver

@nslogx
Copy link
Owner

nslogx commented May 12, 2020

#17

@Emex4gman
Copy link
Author

Emex4gman commented May 12, 2020

Apparently, after trying this method, I ran into some issues,

it's hard to use this method when I am using the onGenerateRoute parameter.

 class MyApp extends StatelessWidget {
  @override
  Widget build(BuildContext context) {
    return ChangeNotifierProvider<StateManagerHelper>(
      create: (context) => StateManagerHelper(),
      child: MaterialApp(
        debugShowCheckedModeBanner: false,
        title: 'TruthX',
        theme: common.theme['new'],
        home: LoadingScreen(),
        onGenerateRoute: (settings) => RouteGenerator.generateRoute(settings),
      ),
    );
  }
}

@huangjianke how can I use flutter_easyloading in this case

@nikitaIndianic
Copy link

i am also facing same issue
i also tried with fluttereasyloading
but not working in latest stable version

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

4 participants