Skip to content

Commit 5049e4d

Browse files
committed
Merge branch 'chan150-master' into develop
2 parents 3b6f423 + 73898d4 commit 5049e4d

35 files changed

+615
-183
lines changed

lib/src/helper/filter_helper.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -504,11 +504,11 @@ class PlutoGridFilterPopupHeader extends StatelessWidget {
504504
final SetFilterPopupHandler? handleAddNewFilter;
505505

506506
const PlutoGridFilterPopupHeader({
507-
Key? key,
507+
super.key,
508508
this.stateManager,
509509
this.configuration,
510510
this.handleAddNewFilter,
511-
}) : super(key: key);
511+
});
512512

513513
void handleAddButton() {
514514
handleAddNewFilter!(stateManager);

lib/src/helper/pluto_key_manager_event.dart

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ import 'package:flutter/services.dart';
33

44
class PlutoKeyManagerEvent {
55
FocusNode focusNode;
6-
RawKeyEvent event;
6+
KeyEvent event;
77

88
PlutoKeyManagerEvent({
99
required this.focusNode,
@@ -12,9 +12,9 @@ class PlutoKeyManagerEvent {
1212

1313
bool get needsThrottle => isMoving || isTab || isPageUp || isPageDown;
1414

15-
bool get isKeyDownEvent => event.runtimeType == RawKeyDownEvent;
15+
bool get isKeyDownEvent => event.runtimeType == KeyDownEvent;
1616

17-
bool get isKeyUpEvent => event.runtimeType == RawKeyUpEvent;
17+
bool get isKeyUpEvent => event.runtimeType == KeyUpEvent;
1818

1919
bool get isMoving => isHorizontal || isVertical;
2020

@@ -94,15 +94,16 @@ class PlutoKeyManagerEvent {
9494
}
9595

9696
bool get isShiftPressed {
97-
return event.isShiftPressed;
97+
return HardwareKeyboard.instance.isShiftPressed;
9898
}
9999

100100
bool get isCtrlPressed {
101-
return event.isMetaPressed || event.isControlPressed;
101+
return HardwareKeyboard.instance.isMetaPressed ||
102+
HardwareKeyboard.instance.isControlPressed;
102103
}
103104

104105
bool get isAltPressed {
105-
return event.isAltPressed;
106+
return HardwareKeyboard.instance.isAltPressed;
106107
}
107108

108109
bool get isModifierPressed {

lib/src/manager/pluto_grid_key_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -79,7 +79,7 @@ class PlutoGridKeyManager {
7979
if (stateManager.configuration.shortcut.handle(
8080
keyEvent: keyEvent,
8181
stateManager: stateManager,
82-
state: RawKeyboard.instance,
82+
state: HardwareKeyboard.instance,
8383
)) {
8484
return;
8585
}

lib/src/manager/pluto_grid_state_manager.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -205,8 +205,8 @@ class PlutoGridStateChangeNotifier extends PlutoChangeNotifier
205205
/// stateManager.refRows.addAll(FilteredList(initialList: value));
206206
/// stateManager.notifyListeners();
207207
/// });
208-
/// {@endtemplate}
209208
/// ```
209+
/// {@endtemplate}
210210
class PlutoGridStateManager extends PlutoGridStateChangeNotifier {
211211
PlutoGridStateManager({
212212
required super.columns,

lib/src/manager/shortcut/pluto_grid_shortcut.dart

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ class PlutoGridShortcut {
2727
bool handle({
2828
required PlutoKeyManagerEvent keyEvent,
2929
required PlutoGridStateManager stateManager,
30-
required RawKeyboard state,
30+
required HardwareKeyboard state,
3131
}) {
3232
for (final action in actions.entries) {
3333
if (action.key.accepts(keyEvent.event, state)) {

lib/src/manager/shortcut/pluto_grid_shortcut_action.dart

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -250,7 +250,7 @@ class PlutoGridActionDefaultTab extends PlutoGridShortcutAction {
250250

251251
final saveIsEditing = stateManager.isEditing;
252252

253-
keyEvent.event.isShiftPressed
253+
HardwareKeyboard.instance.isShiftPressed
254254
? _moveCellPrevious(stateManager)
255255
: _moveCellNext(stateManager);
256256

@@ -408,7 +408,7 @@ class PlutoGridActionDefaultEnterKey extends PlutoGridShortcutAction {
408408
}
409409

410410
if (enterKeyAction.isEditingAndMoveDown) {
411-
if (keyEvent.event.isShiftPressed) {
411+
if (HardwareKeyboard.instance.isShiftPressed) {
412412
stateManager.moveCurrentCell(
413413
PlutoMoveDirection.up,
414414
notify: false,
@@ -420,7 +420,7 @@ class PlutoGridActionDefaultEnterKey extends PlutoGridShortcutAction {
420420
);
421421
}
422422
} else if (enterKeyAction.isEditingAndMoveRight) {
423-
if (keyEvent.event.isShiftPressed) {
423+
if (HardwareKeyboard.instance.isShiftPressed) {
424424
stateManager.moveCurrentCell(
425425
PlutoMoveDirection.left,
426426
force: true,

lib/src/manager/state/column_state.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -304,12 +304,12 @@ mixin ColumnState implements IPlutoGridState {
304304

305305
@override
306306
PlutoColumn? get currentColumn {
307-
return currentCell == null ? null : currentCell!.column;
307+
return currentCell?.column;
308308
}
309309

310310
@override
311311
String? get currentColumnField {
312-
return currentCell == null ? null : currentCell!.column.field;
312+
return currentCell?.column.field;
313313
}
314314

315315
@override

lib/src/plugin/pluto_lazy_pagination.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -413,9 +413,7 @@ class _PaginationWidgetState extends State<_PaginationWidget> {
413413
? SystemMouseCursors.basic
414414
: SystemMouseCursors.click,
415415
),
416-
..._pageNumbers
417-
.map(_makeNumberButton)
418-
.toList(growable: false),
416+
..._pageNumbers.map(_makeNumberButton),
419417
IconButton(
420418
onPressed: _isLastPage ? null : _nextPage,
421419
icon: const Icon(Icons.navigate_next),

lib/src/plugin/pluto_pagination.dart

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,7 @@ class PlutoPaginationState extends _PlutoPaginationStateWithChange {
237237
? SystemMouseCursors.basic
238238
: SystemMouseCursors.click,
239239
),
240-
..._pageNumbers
241-
.map(_makeNumberButton)
242-
.toList(growable: false),
240+
..._pageNumbers.map(_makeNumberButton),
243241
IconButton(
244242
onPressed: _isLastPage ? null : _nextPage,
245243
icon: const Icon(Icons.navigate_next),

lib/src/pluto_dual_grid.dart

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -68,8 +68,8 @@ class PlutoDualGrid extends StatefulWidget {
6868
this.onSelected,
6969
this.display,
7070
this.divider = const PlutoDualGridDivider(),
71-
Key? key,
72-
}) : super(key: key);
71+
super.key,
72+
});
7373

7474
static const double dividerWidth = 10;
7575

@@ -262,8 +262,8 @@ class PlutoDualGridDividerWidget extends StatefulWidget {
262262
required this.indicatorColor,
263263
required this.draggingColor,
264264
required this.dragCallback,
265-
Key? key,
266-
}) : super(key: key);
265+
super.key,
266+
});
267267

268268
@override
269269
State<PlutoDualGridDividerWidget> createState() =>

0 commit comments

Comments
 (0)