data.dart 612 B

1234567891011121314151617181920212223242526272829303132333435
  1. import 'package:flowy_sdk/protobuf/flowy-grid-data-model/grid.pb.dart';
  2. class GridInfo {
  3. List<Row> rows;
  4. List<Field> fields;
  5. GridInfo({
  6. required this.rows,
  7. required this.fields,
  8. });
  9. GridRowData rowAtIndex(int index) {
  10. final row = rows[index];
  11. return GridRowData(
  12. row: row,
  13. fields: fields,
  14. cellMap: row.cellByFieldId,
  15. );
  16. }
  17. int numberOfRows() {
  18. return rows.length;
  19. }
  20. }
  21. class GridRowData {
  22. Row row;
  23. List<Field> fields;
  24. Map<String, Cell> cellMap;
  25. GridRowData({
  26. required this.row,
  27. required this.fields,
  28. required this.cellMap,
  29. });
  30. }