flutter icon indicating copy to clipboard operation
flutter copied to clipboard

Hardware keyboard bug?

Open MiesSuomesta opened this issue 1 year ago • 0 comments

Steps to reproduce

══╡ EXCEPTION CAUGHT BY SERVICES LIBRARY ╞══════════════════════════════════════════════════════════ The following assertion was thrown during a platform message callback: A KeyDownEvent is dispatched, but the state shows that the physical key is already pressed. If this occurs in real application, please report this bug to Flutter. If this occurs in unit tests, please ensure that simulated events follow Flutter's event model as documented in HardwareKeyboard. This was the event: KeyDownEvent#29484(physicalKey: PhysicalKeyboardKey#f0183(usbHidUsage: "0x000700e2", debugName: "Alt Left"), logicalKey: LogicalKeyboardKey#e5ce6(keyId: "0x200000104", keyLabel: "Alt Left", debugName: "Alt Left"), character: null, timeStamp: 19:06:16.127000) 'package:flutter/src/services/hardware_keyboard.dart': Failed assertion: line 509 pos 16: '!_pressedKeys.containsKey(event.physicalKey)'

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.yml

When the exception was thrown, this was the stack: #2 HardwareKeyboard._assertEventIsRegular. (package:flutter/src/services/hardware_keyboard.dart:509:16) #3 HardwareKeyboard._assertEventIsRegular (package:flutter/src/services/hardware_keyboard.dart:524:6) #4 HardwareKeyboard.handleKeyEvent (package:flutter/src/services/hardware_keyboard.dart:646:5) #5 KeyEventManager.handleRawKeyMessage (package:flutter/src/services/hardware_keyboard.dart:1167:37) #6 BasicMessageChannel.setMessageHandler. (package:flutter/src/services/platform_channel.dart:235:49) #7 _DefaultBinaryMessenger.setMessageHandler. (package:flutter/src/services/binding.dart:618:35) #8 _invoke2 (dart:ui/hooks.dart:344:13) #9 _ChannelCallbackRecord.invoke (dart:ui/channel_buffers.dart:45:5) #10 _Channel.push (dart:ui/channel_buffers.dart:135:31) #11 ChannelBuffers.push (dart:ui/channel_buffers.dart:343:17) #12 PlatformDispatcher._dispatchPlatformMessage (dart:ui/platform_dispatcher.dart:750:22) #13 _dispatchPlatformMessage (dart:ui/hooks.dart:257:31) (elided 2 frames from class _AssertionError)

Expected results

No exceptions.

Actual results

I dont know, just sumble don this while doing showDialog with:

showDialog( context: context, builder: (BuildContext context) { this.EditorActionLoadNote("dummy");

    return AlertDialog(
      title: Text('Editoi muistiinpanoa..'),
      content: editor as Widget, // Oma widgetti
      actions: [
        ElevatedButton(
          onPressed: () {
            restoreData();
            push_message_to_user("Note restored...");
          },
          child: Text('Restore'),
        ),
        SizedBox(width: 10),
        ElevatedButton(
          onPressed: () {
            saveData();
            push_message_to_user("Note saved...");
          },
          child: Text('Save'),
        ),
        SizedBox(width: 10),
        ElevatedButton(
          onPressed: () {
            saveData();
            setState(() {
              open_editor = false;
              this.EditorActionCloseNote(_controller.text);
            });
            Navigator.of(context).pop();
            push_message_to_user("Closing editor ....");
          },
          child: Text('Close editor'),
        ),
        TextButton(
          child: Text('Sulje'),
          onPressed: () {
            Navigator.of(context).pop();
          },
        ),
      ],
    );
  },
);

Code sample

Code sample
[Paste your code here]

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[Paste your output here]

MiesSuomesta avatar Oct 29 '24 16:10 MiesSuomesta