flutter_login icon indicating copy to clipboard operation
flutter_login copied to clipboard

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

Open SalahAdDin opened this issue 3 years ago • 4 comments

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:

https://user-images.githubusercontent.com/5034215/116046350-aa1abf80-a67b-11eb-8cdd-845d52c340ad.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: ┤[email protected]├, 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: ┤[email protected]├, 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: ┤[email protected]├, 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 avatar Apr 26 '21 07:04 SalahAdDin

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

SalahAdDin avatar May 19 '21 15:05 SalahAdDin

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 avatar May 19 '21 16:05 SalahAdDin

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()),
    );
  }
}

SalahAdDin avatar May 19 '21 16:05 SalahAdDin

How is new sample?

shinriyo avatar Dec 26 '23 14:12 shinriyo