Dart Grid

Pub

This package allows you to work with data tables like Excel, while saving only real data (empty data is only generated).

BuyMeACoffee

Check flutter_grid_ui for UI implementation

Getting Started

To use this package, add dart_grid as a dependency in your pubspec.yaml file.

dependencies:
  dart_grid: <latest_version>

Using

import 'package:dart_grid/dart_grid.dart';

Example

void main() {
  var grid = Grid<int>();

  grid.add(CellData(index: 0, data: 1));
  grid.add(CellData(index: 1, data: 2));
  grid.add(CellData(index: 2, data: 3));
  grid.putAt(3, [CellData(index: 3, data: 4)]);
  grid.add(CellData(index: 4, data: 5));

  grid.removeAt(2, offset: true);

  for (var i = 0; i < grid.lengthRows; i++) {
    print('Row index ${grid.rows[i].index}: ${grid.datas[i]}');
  }
}

Result

Row index 0: [1, null, null, null, null]
Row index 1: [null, 2, null, null, null]
Row index 2: [null, null, null, 4, null]
Row index 3: [null, null, null, null, 5]

Sponsoring

I'm working on my packages on my free-time, but I don't have as much time as I would. If this package or any other package I created is helping you, please consider to sponsor me so that I can take time to read the issues, fix bugs, merge pull requests and add features to these packages.

Contributions

Feel free to contribute to this project.

If you find a bug or want a feature, but don't know how to fix/implement it, please fill an issue.
If you fixed a bug or implemented a feature, please send a pull request.

Libraries

dart_grid