Skip to content

Commit 3a2e741

Browse files
authored
Merge pull request #1021 from bosskmk/develop
Develop
2 parents 44d2317 + 2b0d6c4 commit 3a2e741

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

45 files changed

+774
-260
lines changed

CHANGELOG.md

Lines changed: 88 additions & 52 deletions
Large diffs are not rendered by default.

README.md

Lines changed: 24 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,40 +1,46 @@
1-
## PlutoGrid for flutter - v7.0.2
1+
## PlutoGrid for flutter - v8.0.0
22

33
[![Awesome Flutter](https://img.shields.io/badge/Awesome-Flutter-blue.svg)](https://github.com/Solido/awesome-flutter)
44
[![codecov](https://codecov.io/gh/bosskmk/pluto_grid/branch/master/graph/badge.svg)](https://codecov.io/gh/bosskmk/pluto_grid)
55
[![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
66

77
<br>
88

9-
`PlutoGrid` is a `DataGrid` that can be operated with the keyboard in various situations such as moving cells.
9+
`PlutoGrid` is a `DataGrid` that can be operated with the keyboard in various situations such as
10+
moving cells.
1011
It is developed with priority on the web and desktop.
1112
Improvements such as UI on mobile are being considered.
1213
If you comment on an issue, mobile improvements can be made quickly.
1314

1415
<br>
1516

1617
### [Demo Web](https://bosskmk.github.io/pluto_grid/build/web/index.html)
18+
1719
> You can try out various functions and usage methods right away.
1820
> All features provide example code.
1921
2022
<br>
2123

2224
### [Pub.Dev](https://pub.dev/packages/pluto_grid)
25+
2326
> Check out how to install from the official distribution site.
2427
2528
<br>
2629

2730
### [Documentation](https://pluto.weblaze.dev/series/pluto-grid)
31+
2832
> The documentation has more details.
2933
3034
<br>
3135

3236
### [ChangeLog](https://github.com/bosskmk/pluto_grid/blob/master/CHANGELOG.md)
37+
3338
> Please note the changes when changing the version of PlutoGrid you are using.
3439
3540
<br>
3641

3742
### [Issue](https://github.com/bosskmk/pluto_grid/issues)
43+
3844
> Report any questions or errors.
3945
4046
<br>
@@ -50,59 +56,71 @@ If you comment on an issue, mobile improvements can be made quickly.
5056
### Screenshots
5157

5258
#### Change the color of the rows or make the cells look the way you want them.
59+
5360
![PlutoGrid Normal](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_01.png)
5461

5562
<br>
5663

5764
#### Date type input can be easily selected by pop-up and keyboard.
65+
5866
![PlutoGrid Select Popup](https://bosskmk.github.io/images/pluto_grid/3.1.0/pluto_grid_3.1.0_01.png)
5967

6068
<br>
6169

6270
#### The selection type column can be easily selected using a pop-up and keyboard.
71+
6372
![PlutoGrid Select Date](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_03.png)
6473

6574
<br>
6675

6776
#### Group columns by desired depth.
77+
6878
![PlutoGrid Cell renderer](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_04.png)
6979

7080
<br>
7181

7282
#### Grid can be expressed in dark mode or a combination of desired colors. Also, freeze the column, move it by dragging, or adjust the size.
83+
7384
![PlutoGrid Multi select](https://bosskmk.github.io/images/pluto_grid/2.8.0/pluto_grid_2.8.0_05.png)
7485

7586
<br>
7687

7788
### Example
89+
7890
Generate the data to be used in the grid.
91+
7992
```dart
8093
8194
List<PlutoColumn> columns = [
95+
8296
/// Text Column definition
8397
PlutoColumn(
8498
title: 'text column',
8599
field: 'text_field',
86100
type: PlutoColumnType.text(),
87101
),
102+
88103
/// Number Column definition
89104
PlutoColumn(
90105
title: 'number column',
91106
field: 'number_field',
92107
type: PlutoColumnType.number(),
93108
),
109+
94110
/// Select Column definition
95111
PlutoColumn(
96112
title: 'select column',
97113
field: 'select_field',
98114
type: PlutoColumnType.select(['item1', 'item2', 'item3']),
99115
),
116+
100117
/// Datetime Column definition
101118
PlutoColumn(
102119
title: 'date column',
103120
field: 'date_field',
104121
type: PlutoColumnType.date(),
105122
),
123+
106124
/// Time Column definition
107125
PlutoColumn(
108126
title: 'time column',
@@ -143,6 +161,7 @@ List<PlutoRow> rows = [
143161
```
144162

145163
Create a grid with the data created above.
164+
146165
```dart
147166
@override
148167
Widget build(BuildContext context) {
@@ -173,6 +192,7 @@ Widget build(BuildContext context) {
173192

174193
| Flutter | PlutoGrid |
175194
|------------------|-----------------------|
195+
| 3.19.0 or higher | 8.0.0 or higher |
176196
| 3.10.0 or higher | 7.0.0 or higher |
177197
| 3.7.0 or higher | 6.0.0 or higher |
178198
| 3.3.0 or higher | 5.0.6 or higher |
@@ -184,7 +204,9 @@ For other versions, contact the issue
184204
<br>
185205

186206
### Related packages
207+
187208
> develop packages that make it easy to develop admin pages or CMS with Flutter.
209+
188210
* [PlutoGrid](https://github.com/bosskmk/pluto_grid)
189211
* [PlutoMenuBar](https://github.com/bosskmk/pluto_menu_bar)
190212
* [PlutoLayout](https://github.com/bosskmk/pluto_layout)
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
C:/Users/manek/AppData/Local/Pub/Cache/hosted/pub.dev/printing-5.9.3/

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

0 commit comments

Comments
 (0)