Skip to content

Commit f7dcd55

Browse files
author
Ellet
committed
Update and fix some changes of Update deprecated code from flutter 3.19
1 parent 431ae4b commit f7dcd55

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ All notable changes to this project will be documented in this file.
44

55
## 9.3.0
66
* Breaking change: `Document.fromHtml(html)` is now returns `Document` instead of `Delta`, use `DeltaX.fromHtml` to return `Delta`
7+
* Update old deprecated api from Flutter 3.19
78

89
## 9.2.14
910
* feat: move cursor after inserting video/image

example/lib/main.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,5 @@
11
import 'package:flutter/foundation.dart' show kIsWeb;
22
import 'package:flutter/material.dart';
3-
import 'package:flutter/services.dart';
43
import 'package:flutter_bloc/flutter_bloc.dart';
54
import 'package:flutter_localizations/flutter_localizations.dart'
65
show

lib/src/widgets/editor/editor.dart

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -453,11 +453,10 @@ class _QuillEditorSelectionGestureDetectorBuilder
453453
}
454454

455455
bool isShiftClick(PointerDeviceKind deviceKind) {
456+
final pressed = HardwareKeyboard.instance.logicalKeysPressed;
456457
return deviceKind == PointerDeviceKind.mouse &&
457-
(HardwareKeyboard.instance
458-
.isLogicalKeyPressed(LogicalKeyboardKey.shiftLeft) ||
459-
HardwareKeyboard.instance
460-
.isLogicalKeyPressed(LogicalKeyboardKey.shiftRight));
458+
(pressed.contains(LogicalKeyboardKey.shiftLeft) ||
459+
pressed.contains(LogicalKeyboardKey.shiftRight));
461460
}
462461

463462
@override
@@ -740,10 +739,10 @@ class RenderEditor extends RenderEditableContainerBox
740739
}
741740

742741
bool get _shiftPressed =>
743-
HardwareKeyboard.instance
744-
.isLogicalKeyPressed(LogicalKeyboardKey.shiftLeft) ||
745-
HardwareKeyboard.instance
746-
.isLogicalKeyPressed(LogicalKeyboardKey.shiftRight);
742+
HardwareKeyboard.instance.logicalKeysPressed
743+
.contains(LogicalKeyboardKey.shiftLeft) ||
744+
HardwareKeyboard.instance.logicalKeysPressed
745+
.contains(LogicalKeyboardKey.shiftRight);
747746

748747
void setStartHandleLayerLink(LayerLink value) {
749748
if (_startHandleLayerLink == value) {

0 commit comments

Comments
 (0)