PlutoGridStateManager couldnt enter the parameter for gridFocusNode and scroll

44 Views Asked by At

For some reason i couldn't enter the parameter for the PlutoGridStateManager constructor which is (gridFocusMode: GridFocusMode.row, scrolling: PlutoGridScrolling.none)

And i check my dependencies in pubspec.yaml which is the latest version (pluto_grid: ^7.0.2). I'm a bit new to the PlutoGrid so maybe i am doing something stupid.

my Code when implementing the PlutoGridStateManager:

class _HistoryPageState extends State<HistoryPage> {

  PlutoGridStateManager? stateManager;

  Future<void> readJson() async {
    // rootBundle.loadString: Load sample as Strings
    final String response =
        await rootBundle.loadString('assets/MyInfo.json');
    final List<dynamic> data = await json.decode(response)["items"];

    final List<PlutoColumn> columns = [
      PlutoColumn(title: 'No', field: 'No', type: PlutoColumnType.text()),
      PlutoColumn(title: 'Name', field: 'name', type: PlutoColumnType.text()),
    ];

    final List<PlutoRow> rows = data.map((item) {
      return PlutoRow(cells: {
        'No': PlutoCell(value: item['No']),
        'name': PlutoCell(value: item['name']),
      });
    }).toList();

    setState(() {
      stateManager = PlutoGridStateManager(columns: columns, rows: rows, gridFocusNode: gridfocusmode, scroll: linked)
      // stateManager = PlutoGridStateManager(columns, rows);
    });
  }
0

There are 0 best solutions below