diff --git a/lib/image/drag.dart b/lib/image/drag.dart index 75eb55b..5ed2b6c 100644 --- a/lib/image/drag.dart +++ b/lib/image/drag.dart @@ -31,12 +31,12 @@ class _DraggableAreaState extends State { bool isPressShift = false; Axis? get axis { - if (isPressCommand) { - return Axis.vertical; - } if (isPressShift) { return Axis.horizontal; } + if (isPressCommand) { + return Axis.vertical; + } return null; } @@ -101,8 +101,11 @@ class _DraggableAreaState extends State { setState(() {}); } if (value is KeyUpEvent && isShift(value)) { - isPressShift = false; - setState(() {}); + Future.delayed(const Duration(milliseconds: 500)).then((value) { + isPressShift = false; + if (!mounted) return; + setState(() {}); + }); } if (value is! KeyDownEvent && value is! KeyRepeatEvent) { return KeyEventResult.ignored;