PlutoGridMode

Search for a command to run...

No comments yet. Be the first to comment.
PlutoGrid is a data grid. It is a Flutter package that allows you to easily edit large amounts of data with the keyboard. It can be used on any platform supported by Flutter.
PlutoGrid has default shortcut keys set, and users can change or set shortcut keys. Shortcut Range The scope of the shortcut depends on the focus. PlutoGrid : In the state that TextField is not focused. You can set custom shortcut keys. TextField :...
A unique id can be set for PlutoMenuItem. PlutoMenuItem( id: 'unique_id', title: 'Menu 1', ) If PlutoMenuItem is created in build method, you should set a unique id for PlutoMenuItem.Otherwise, when PlutoMenuBar is rebuilt, incorrect actions suc...

The default ScrollBehavior.dragDevices of PlutoGrid is as follows.(dragDevices is a setting that allows scrolling by dragging to the set pointer type.) // In case of Mobile { PointerDeviceKind.touch, PointerDeviceKind.stylus, PointerDeviceKind....

Example code to add custom widget to PlutoMenuBar.

PlutoGrid has default shortcut keys set, and users can change or set shortcut keys. Shortcut Range The scope of the shortcut depends on the focus. PlutoGrid : In the state that TextField is not focused. You can set custom shortcut keys. TextField :...

PlutoLayout is a Flutter package for configuring layouts such as CMS or admin service.You can configure tab views or menus on the top, bottom, left, and right sides.It also supports keyboard shortcuts and allows you to toggle or resize the tab view. ...

The modes of PlutoGrid are normal, readOnly, select, selectWithOneTap, multiSelect, and popup.
The popup mode is intended to be used by internal widgets.
The rest of the modes are used as follows according to the user's purpose.
normal modeAs a basic mode, there are no restrictions on editing and operation.
readOnly modeIn this mode, cell editing is restricted.
select or selectWithOneTap modeThis mode is for single row selection. When a row is selected, the PlutoGrid.onSelected callback is called.
In select mode, the PlutoGrid.onSelected callback is called only when the currently selected row is tapped or the enter key is pressed.
The selectWithOneTap mode will call the PlutoGrid.onSelected callback when a row is tapped, regardless of whether a row is currently selected or not.
The selected row is passed as the row, rowIdx,cellvalues of theonSelected` callback.
multiSelect modeThis mode is for selecting multiple rows. You can select or deselect rows with a single tap.
You can also select rows with the keyboard shift + arrowUp/Down, shift + tap, control + tap, etc.
However, when selecting a row with the keyboard, the PlutoGrid.onSelected callback is called only when the enter key is pressed.
Selected rows are listed in the List<PlutoRow>? passed as the selectedRows value.
Typing escape will undo all selected rows. In this case, selectedRows returns null.
setState of StatefulWidget as shown below.import 'package:flutter/material.dart';
import 'package:pluto_grid/pluto_grid.dart';
import '../dummy_data/development.dart';
class EmptyScreen extends StatefulWidget {
static const routeName = 'empty';
const EmptyScreen({Key? key}) : super(key: key);
@override
_EmptyScreenState createState() => _EmptyScreenState();
}
class _EmptyScreenState extends State<EmptyScreen> {
late List<PlutoColumn> columns;
late List<PlutoRow> rows;
late PlutoGridStateManager stateManager;
PlutoGridMode mode = PlutoGridMode.normal;
@override
void initState() {
super.initState();
final dummyData = DummyData(5, 5);
columns = dummyData.columns;
rows = dummyData.rows;
}
@override
Widget build(BuildContext context) {
return Scaffold(
body: SafeArea(
child: Container(
padding: const EdgeInsets.all(15),
child: PlutoGrid(
mode: mode,
columns: columns,
rows: rows,
onChanged: (PlutoGridOnChangedEvent event) {
print(event);
},
onLoaded: (PlutoGridOnLoadedEvent event) {
stateManager = event.stateManager;
},
createHeader: (s) => TextButton(
onPressed: () {
setState(() {
mode = mode.isNormal == true
? PlutoGridMode.readOnly
: PlutoGridMode.normal;
});
},
child: const Text('Change mode'),
),
configuration: const PlutoGridConfiguration(),
),
),
),
);
}
}