plutogrid for flutter
plutogrid is a data grid that can be controlled by the keyboard on desktop and web.
of course, it works well on android and ios.
demo web
try some simple features on the demo site.
pub.dev
check out how to install from the official distribution site.
documentation
the documentation has more details.
issue
report any questions or errors.
features
- columns
- dragging the column heading moves the column left and right.
- drag the icon to the right of the column heading to adjust the width of the column.
- click the icon to the right of the column title to fix the column left or right or automatically adjust the width of the column.
- ascending or descending the list by clicking on a column heading.
- text, number, date, time, select list type column.
- (to do) filtering.
- (to do) multi sorting.
- (to do) hide specific columns.
- selection
- row mode – select rows.
- square mode – select a square area like excel.
- none mode – not selectable.
- (row mode) – select row by control(meta on macos) + click.
- (row, square mode) – (shift + arrow keys) or (shift + click) or (long tapping and move) to select.
- select all rows or cells. control(meta on macos) + a.
- copy and paste
- control(meta on macos) + c or v
- if there is no selected cell, it operates based on the current cell.
- if there are selected rows in row mode, it operates based on the selected state.
- works even if rows are selected irregularly in row mode.
- moving
- move with arrow keys.
- press enter to edit the cell or move it down.
- tab key to move left and right cells.
- shift + (enter, tap) works in the opposite direction.
- dual mode
- working with different grids on both sides.
- at the end of the grid, you can move between grids with the left and right arrow keys, or the tab key.
- ui for mobile
- (to do) – ui for convenient use on mobile.
- internationalization
- (to do) – support a lot of languages.
screenshots
with fixed columns on the left and right
popup for select list type columns
popup for select date type columns
dual grid
select rows
select cells
example
generate the data to be used in the grid.
list<plutocolumn> columns = [
/// text column definition
plutocolumn(
title: 'text column',
field: 'text_field',
type: plutocolumntype.text(),
),
/// number column definition
plutocolumn(
title: 'number column',
field: 'number_field',
type: plutocolumntype.number(),
),
/// select column definition
plutocolumn(
title: 'select column',
field: 'select_field',
type: plutocolumntype.select(['item1', 'item2', 'item3']),
),
/// datetime column definition
plutocolumn(
title: 'date column',
field: 'date_field',
type: plutocolumntype.date(),
),
/// time column definition
plutocolumn(
title: 'time column',
field: 'time_field',
type: plutocolumntype.time(),
),
];
list<plutorow> rows = [
plutorow(
cells: {
'text_field': plutocell(value: 'text cell value1'),
'number_field': plutocell(value: 2020),
'select_field': plutocell(value: 'item1'),
'date_field': plutocell(value: '2020-08-06'),
'time_field': plutocell(value: '12:30'),
},
),
plutorow(
cells: {
'text_field': plutocell(value: 'text cell value2'),
'number_field': plutocell(value: 2021),
'select_field': plutocell(value: 'item2'),
'date_field': plutocell(value: '2020-08-07'),
'time_field': plutocell(value: '18:45'),
},
),
plutorow(
cells: {
'text_field': plutocell(value: 'text cell value3'),
'number_field': plutocell(value: 2022),
'select_field': plutocell(value: 'item3'),
'date_field': plutocell(value: '2020-08-08'),
'time_field': plutocell(value: '23:59'),
},
),
];
create a grid with the data created above.
@override
widget build(buildcontext context) {
return scaffold(
appbar: appbar(
title: const text('plutogrid demo'),
),
body: container(
padding: const edgeinsets.all(30),
child: plutogrid(
columns: columns,
rows: rows,
onchanged: (plutoonchangedevent event) {
print(event);
},
onloaded: (plutoonloadedevent event) {
print(event);
}
),
),
);
}
pluto series
develop packages that make it easy to develop admin pages or cms with flutter.
Comments are closed.