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

No Overlay widget exists above EditableText when using keyboard(computer's emulator) #163

Open
SalahAdDin opened this issue Apr 26, 2021 · 4 comments
Labels
bug Something isn't working

Comments

@SalahAdDin
Copy link
Contributor

Describe the bug

When I'm testing my Login screen on an emulator and I input email or password with the computer's keyboard I get the next behaviour if i try to delete letter or move the text cursor back:

Record_player_20210425153830.mp4

Followed by the next report on the debug console:

======== Exception caught by gesture ===============================================================
The following assertion was thrown while handling a gesture:
No Overlay widget exists above EditableText-[LabeledGlobalKey<EditableTextState>#a58bd](controller: TextEditingController#2a787(TextEditingValue(text: ┤luis.alaguna@cloudnesil.com├, selection: TextSelection(baseOffset: 27, extentOffset: 27, affinity: TextAffinity.upstream, isDirectional: false), composing: TextRange(start: -1, end: -1))), focusNode: FocusNode#861eb([PRIMARY FOCUS]), debugLabel: ((englishLike subhead 2014).merge(whiteMountainView subtitle1)).copyWith, inherit: false, color: Color(0xa6000000), family: Roboto, size: 14.0, weight: 400, baseline: alphabetic, decoration: TextDecoration.none, textAlign: start, keyboardType: TextInputType(name: TextInputType.emailAddress, signed: null, decimal: null), autofillHints: [username], dirty, dependencies: [_FocusMarker, Directionality, MediaQuery], state: EditableTextState#f1c98(tickers: tracking 2 tickers)).
Usually the Navigator created by WidgetsApp provides the overlay. Perhaps your app content was created above the Navigator with the WidgetsApp builder parameter.
'package:flutter/src/widgets/text_selection.dart':
Failed assertion: line 314 pos 12: 'overlay != null'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack: 
#2      new TextSelectionOverlay (package:flutter/src/widgets/text_selection.dart:314:12)
#3      EditableTextState._handleSelectionChanged (package:flutter/src/widgets/editable_text.dart:2122:27)
#4      RenderEditable._handleSelectionChange (package:flutter/src/rendering/editable.dart:470:26)
#5      RenderEditable.selectPositionAt (package:flutter/src/rendering/editable.dart:1916:5)
#6      RenderEditable.selectPosition (package:flutter/src/rendering/editable.dart:1888:5)
...
Handler: "onTapUp"
Recognizer: _TransparentTapGestureRecognizer#a726e
  debugOwner: _TextSelectionGestureDetectorState#c556b
  state: ready
  won arena
  finalPosition: Offset(479.2, 388.3)
  finalLocalPosition: Offset(259.2, 20.3)
  button: 1
  sent tap down
====================================================================================================

======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
No Overlay widget exists above EditableText-[LabeledGlobalKey<EditableTextState>#a58bd](controller: TextEditingController#2a787(TextEditingValue(text: ┤luis.alaguna@cloudnesil.com├, selection: TextSelection(baseOffset: 26, extentOffset: 26, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1))), focusNode: FocusNode#861eb([PRIMARY FOCUS]), debugLabel: ((englishLike subhead 2014).merge(whiteMountainView subtitle1)).copyWith, inherit: false, color: Color(0xa6000000), family: Roboto, size: 14.0, weight: 400, baseline: alphabetic, decoration: TextDecoration.none, textAlign: start, keyboardType: TextInputType(name: TextInputType.emailAddress, signed: null, decimal: null), autofillHints: [username], dirty, dependencies: [_FocusMarker, Directionality, MediaQuery], state: EditableTextState#f1c98(tickers: tracking 2 tickers)).
Usually the Navigator created by WidgetsApp provides the overlay. Perhaps your app content was created above the Navigator with the WidgetsApp builder parameter.
'package:flutter/src/widgets/text_selection.dart':
Failed assertion: line 314 pos 12: 'overlay != null'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack: 
#2      new TextSelectionOverlay (package:flutter/src/widgets/text_selection.dart:314:12)
#3      EditableTextState._handleSelectionChanged (package:flutter/src/widgets/editable_text.dart:2122:27)
#4      RenderEditable._handleSelectionChange (package:flutter/src/rendering/editable.dart:470:26)
#5      RenderEditable._handleDelete (package:flutter/src/rendering/editable.dart:872:7)
#6      RenderEditable._handleKeyEvent (package:flutter/src/rendering/editable.dart:550:7)
...
====================================================================================================

======== Exception caught by services library ======================================================
The following assertion was thrown during a platform message callback:
No Overlay widget exists above EditableText-[LabeledGlobalKey<EditableTextState>#a58bd](controller: TextEditingController#2a787(TextEditingValue(text: ┤luis.alaguna@cloudnesil.com├, selection: TextSelection(baseOffset: 25, extentOffset: 25, affinity: TextAffinity.downstream, isDirectional: false), composing: TextRange(start: -1, end: -1))), focusNode: FocusNode#861eb([PRIMARY FOCUS]), debugLabel: ((englishLike subhead 2014).merge(whiteMountainView subtitle1)).copyWith, inherit: false, color: Color(0xa6000000), family: Roboto, size: 14.0, weight: 400, baseline: alphabetic, decoration: TextDecoration.none, textAlign: start, keyboardType: TextInputType(name: TextInputType.emailAddress, signed: null, decimal: null), autofillHints: [username], dirty, dependencies: [_FocusMarker, Directionality, MediaQuery], state: EditableTextState#f1c98(tickers: tracking 2 tickers)).
Usually the Navigator created by WidgetsApp provides the overlay. Perhaps your app content was created above the Navigator with the WidgetsApp builder parameter.
'package:flutter/src/widgets/text_selection.dart':
Failed assertion: line 314 pos 12: 'overlay != null'


Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
  https://github.com/flutter/flutter/issues/new?template=2_bug.md

When the exception was thrown, this was the stack: 
#2      new TextSelectionOverlay (package:flutter/src/widgets/text_selection.dart:314:12)
#3      EditableTextState._handleSelectionChanged (package:flutter/src/widgets/editable_text.dart:2122:27)
#4      RenderEditable._handleSelectionChange (package:flutter/src/rendering/editable.dart:470:26)
#5      RenderEditable._handleDelete (package:flutter/src/rendering/editable.dart:872:7)
#6      RenderEditable._handleKeyEvent (package:flutter/src/rendering/editable.dart:550:7)
...
================================================================================================

To Reproduce
Steps to reproduce the behavior:

  1. Launch the emulator.
  2. Go to the email or password field on the LoginScreen.
  3. Type password or email.
  4. Go back or delete characters on.
  5. See the error on the screen.
  6. Go to the Debug Console.
  7. See the error logs.

Expected behavior
It was normally working: when you move or delete there is no any log in console, going back with the cursor does work correctly and deleting from keyboard also works fine.

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

Information (please complete the following information):

  • Device: Tablet
  • Platform: Android 10 API 29
  • Flutter version: 2.0.5
  • Package version: flutter_login: ^2.0.0-nullsafety.0

Additional context
Add any other context about the problem here.

@SalahAdDin SalahAdDin added the bug Something isn't working label Apr 26, 2021
@SalahAdDin
Copy link
Contributor Author

@juliansteenbakker I just see the same error again, this time in a Xiaomi Redmi Note 7.

@SalahAdDin
Copy link
Contributor Author

My current code is simple:

class LoginScreen extends HookWidget {
  @override
  Widget build(BuildContext context) {
    final AuthState authScreenState = useProvider(authNotifierProvider);

    final AuthNotifier authNotifier =
        useProvider(authNotifierProvider.notifier);

    final userState = useProvider(userEntityProvider);

    return FlutterLogin(
      title: AppLiterals.title,
      footer: AppLiterals.copyRight,
      // TODO: logo: '',
      messages: LoginMessages(usernameHint: "E-postanın adresi!"),
      loginProviders: <LoginProvider>[
        LoginProvider(
            icon: MdiIcons.facebook,
            callback: () => authNotifier.signInWithFacebook()),
        LoginProvider(
            icon: MdiIcons.google,
            callback: () => authNotifier.signInWithGoogle()),
        LoginProvider(
            icon: MdiIcons.apple,
            callback: () => authNotifier.signInWithApple()),
      ],
      onSignup: (LoginData data) => authNotifier.registerUser(
          username: data.name, password: data.password),
      onLogin: (LoginData data) =>
          authNotifier.signIn(username: data.name, password: data.password),
      onRecoverPassword: (String name) =>
          authNotifier.recoverPassword(username: name),
      onSubmitAnimationCompleted: () => authScreenState.when(
          loading: () => Center(child: CircularProgressIndicator()),
          signedUp: (signedUpUser) => pushToPage(
              context,
              Scaffold(
                body: SurveyScreen(
                    onCompleteSurvey: () => pushAndReplaceToPage(
                        context,
                        Scaffold(
                          body: LobbyScreen(),
                        ))),
              )),
          error: (error) => ErrorScreen(
                message: error,
                actionLabel: 'Home',
                onPressed: () => pushAndReplaceToPage(context, SplashScreen()),
              ),
          loggedOut: () => pushAndReplaceToPage(context, SplashScreen())),
    );
  }
}
@SalahAdDin
Copy link
Contributor Author

With LoginScreen being called by:

class CancerApp extends HookWidget {
  // This widget is the root of your application.
  @override
  Widget build(BuildContext context) {
    final _appRouter = AppRouter();
    final bool darkTheme = useProvider(darkThemeProvider);
    final launcherState = useProvider(launcherProvider);

    SystemChrome.setEnabledSystemUIOverlays([SystemUiOverlay.bottom]);

    return MaterialApp.router(
      title: 'Thesis Cancer',
      theme: darkTheme ? ThemeData.dark() : ThemeData.light(),
      routerDelegate: _appRouter.delegate(),
      routeInformationParser: _appRouter.defaultRouteParser(),
      // home: SplashScreen()
      builder: (context, router) => launcherState.when(
          loading: () => SplashScreen(),
          needsProfile: () => LoginScreen(),
          profileLoaded: () => MainScreen()),
    );
  }
}
@shinriyo
Copy link

How is new sample?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
2 participants