Skip to content

[web] Latest Flutter sync seems to have broken RawKeyboard #33857

Closed

Description

@yjbanov

Steps to Reproduce

  1. Run the gallery demo app
  2. Use the keyboard

Logs

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
print.dart:70 The following assertion was thrown during a platform message callback:
print.dart:70 Unknown keymap for key events: android
print.dart:70 
print.dart:70 When the exception was thrown, this was the stack:
print.dart:70 dart:_runtime/errors.dart 215:3                                throw
print.dart:70 package:flutter_web/src/services/raw_keyboard.dart 264:9       fromMessage
print.dart:70 package:flutter_web/src/services/raw_keyboard.dart 492:31      _handleKeyEvent
print.dart:70 dart:async 197:54                                              runBody
print.dart:70 dart:async 236:5                                               async
print.dart:70 package:flutter_web/src/services/raw_keyboard.dart 491:52      [_handleKeyEvent]
print.dart:70 package:flutter_web/src/services/platform_channel.dart 67:42   <fn>
print.dart:70 dart:async 197:54                                              runBody
print.dart:70 dart:async 236:5                                               async
print.dart:70 package:flutter_web/src/services/platform_channel.dart 66:63   <fn>
print.dart:70 package:flutter_web/src/services/platform_messages.dart 69:26  handlePlatformMessage
print.dart:70 dart:async 197:54                                              runBody
print.dart:70 dart:async 236:5                                               async
print.dart:70 package:flutter_web/src/services/platform_messages.dart 64:52  handlePlatformMessage
print.dart:70 package:flutter_web_ui/src/engine/keyboard.dart 74:14          [_handleHtmlEvent]
print.dart:70 package:flutter_web_ui/src/engine/keyboard.dart 30:23          <fn>
print.dart:70 ════════════════════════════════════════════════════════════════════════════════════════════════════

Flutter for web revision: https://github.com/flutter/flutter_web/commit/69acfd97c5a7bf0605e9a01df7749716ceb1707f

Activity

  1. added
    c: crashStack traces logged to the console
    platform-webWeb applications specifically
    on Jun 4, 2019
  2. added this to the June 2019 milestone on Jun 4, 2019
  3. ilshookim commented on Mar 30, 2020

    @ilshookim

    [web] when I pressed 'caps lock' button in MacBook keyboard,
    I saw almost same problem today in chrome(web).

    ASK: This issue is clear at this time in flutter for web?

    CODE:
    body: RawKeyboardListener(
    focusNode: textNode,
    onKey: (RawKeyEvent rawKeyEvent) {
    try {
    bool keyDown = false; bool keyUp = false;
    if (rawKeyEvent.runtimeType == RawKeyDownEvent) keyDown = true;
    if (rawKeyEvent.runtimeType == RawKeyUpEvent) keyUp = true;
    if (keyUp) {
    logger.fine('keyDown=$keyDown, keyUp=$keyUp, rawKeyEvent=${rawKeyEvent.logicalKey.debugName}');
    if (rawKeyEvent.logicalKey.keyId == LogicalKeyboardKey.backspace.keyId) {
    logger.fine('keyId=${rawKeyEvent.logicalKey.keyId}');
    }
    }
    }
    catch (exc) {
    logger.warning('RawKeyboardListener.onKey: (RawKeyEvent): exc=$exc');
    }
    },
    child: Container(
    child: Text('raw keyboard listener enabled')
    ),
    ),

    FLUTTER DOCTOR:
    flutter doctor
    Doctor summary (to see all details, run flutter doctor -v):
    [✓] Flutter (Channel master, v1.16.4-pre.18, on Mac OS X 10.15.4 19E266, locale ko-KR)
    [✓] Android toolchain - develop for Android devices (Android SDK version 29.0.2)
    [✓] Xcode - develop for iOS and macOS (Xcode 11.4)
    [✓] Chrome - develop for the web
    [✓] Android Studio (version 3.6)
    [✓] VS Code (version 1.43.2)
    [✓] Connected device (5 available)

    • No issues found!

    EXCEPTION:
    ══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════
    The following assertion was thrown during a platform message callback:
    Assertion failed: file:///Users/joshua/flutter/packages/flutter/lib/src/widgets/shortcuts.dart:76:16
    keys.isNotEmpty
    is not true

    When the exception was thrown, this was the stack:
    dart-sdk/lib/internal/js_dev_runtime/private/ddc_runtime/errors.dart 195:49 throw
    dart-sdk/lib/_internal/js_dev_runtime/private/ddc_runtime/errors.dart 26:3 assertFailed
    packages/flutter/src/widgets/shortcuts.dart 76:20 fromSet
    packages/flutter/src/widgets/shortcuts.dart 178:63 fromSet
    packages/flutter/src/widgets/shortcuts.dart 297:63 handleKeypress
    packages/flutter/src/widgets/shortcuts.dart 459:20 [_handleOnKey]
    packages/flutter/src/widgets/focus_manager.dart 1536:43 [_handleRawKeyEvent]
    packages/flutter/src/services/raw_keyboard.dart 531:17 _handleKeyEvent
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 86:54 runBody
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 125:12 _async
    packages/flutter/src/services/raw_keyboard.dart 500:34 [_handleKeyEvent]
    packages/flutter/src/services/platform_channel.dart 74:49
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 86:54 runBody
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 125:12 _async
    packages/flutter/src/services/platform_channel.dart 73:57
    packages/flutter/src/services/binding.dart 199:33 handlePlatformMessage
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 86:54 runBody
    dart-sdk/lib/_internal/js_dev_runtime/patch/async_patch.dart 125:12 _async
    packages/flutter/src/services/binding.dart 190:37 handlePlatformMessage
    lib/_engine/engine/window.dart 604:13 _invoke3
    lib/_engine/engine/window.dart 303:5 invokeOnPlatformMessage
    lib/_engine/engine/keyboard.dart 91:12 [_handleHtmlEvent]
    lib/_engine/engine/keyboard.dart 43:7
    ════════════════════════════════════════════════════════════════════════════════════════════════════

  4. lock commented on Apr 15, 2020

    @lock

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  5. locked and limited conversation to collaborators on Apr 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

c: crashStack traces logged to the consoleplatform-webWeb applications specifically

Type

No type

Projects

No projects

    Milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions