SSpreadsheet constructor

const SSpreadsheet({
  1. Key? key,
  2. required int rowCount,
  3. required int columnCount,
  4. required SSpreadsheetCellBuilder cellBuilder,
  5. SSpreadsheetRowHeaderBuilder? rowHeaderBuilder,
  6. SSpreadsheetColumnHeaderBuilder? columnHeaderBuilder,
  7. WidgetBuilder? cornerBuilder,
  8. double rowHeaderWidth = 100,
  9. double headerHeight = 48,
  10. SSpreadsheetRowHeightBuilder? rowHeightBuilder,
  11. SSpreadsheetColumnWidthBuilder? columnWidthBuilder,
  12. EdgeInsetsGeometry padding = EdgeInsets.zero,
  13. EdgeInsetsGeometry rowPadding = EdgeInsets.zero,
  14. IndexedScrollController? verticalIndexedController,
  15. ScrollPhysics? verticalPhysics,
  16. ScrollPhysics? horizontalPhysics,
  17. Color? backgroundColor,
  18. bool showColumnHeader = true,
  19. SSpreadsheetHorizontalMetricsChanged? onHorizontalMetricsChanged,
  20. SSpreadsheetHorizontalSyncController? horizontalSyncController,
  21. bool repaintBoundaryPerRow = false,
  22. Duration rowExtentAnimationDuration = Duration.zero,
  23. bool addAutomaticKeepAlives = false,
  24. bool enableRowAnimations = true,
  25. Key rowKeyBuilder(
    1. int rowIndex
    )?,
  26. Duration rowAnimationDuration = const Duration(milliseconds: 400),
  27. bool enableKeystrokes = false,
  28. bool keystrokeDebugLogs = false,
  29. Map<Type, VoidCallback>? keystrokeActionHandlers,
  30. Map<Type, String>? keystrokeActionLabels,
  31. Map<ShortcutActivator, Intent>? keystrokeShortcuts,
  32. bool includeDefaultKeystrokeShortcuts = true,
  33. void onKeystrokeEvent(
    1. KeyDownEvent
    )?,
  34. FocusNode? keystrokeFocusNode,
  35. bool keystrokeRequestFocusOnInit = true,
  36. bool shouldPauseKeystrokes()?,
  37. SSpreadsheetKeystrokeHudBuilder? keystrokeHudBuilder,
  38. Duration keystrokeHudDuration = const Duration(seconds: 1),
})

Implementation

const SSpreadsheet({
  super.key,
  required this.rowCount,
  required this.columnCount,
  required this.cellBuilder,
  this.rowHeaderBuilder,
  this.columnHeaderBuilder,
  this.cornerBuilder,
  this.rowHeaderWidth = 100,
  this.headerHeight = 48,
  this.rowHeightBuilder,
  this.columnWidthBuilder,
  this.padding = EdgeInsets.zero,
  this.rowPadding = EdgeInsets.zero,
  this.verticalIndexedController,
  this.verticalPhysics,
  this.horizontalPhysics,
  this.backgroundColor,
  this.showColumnHeader = true,
  this.onHorizontalMetricsChanged,
  this.horizontalSyncController,
  this.repaintBoundaryPerRow = false,
  this.rowExtentAnimationDuration = Duration.zero,
  this.addAutomaticKeepAlives = false,
  this.enableRowAnimations = true,
  this.rowKeyBuilder,
  this.rowAnimationDuration = const Duration(milliseconds: 400),
  // Keystroke params
  this.enableKeystrokes = false,
  this.keystrokeDebugLogs = false,
  this.keystrokeActionHandlers,
  this.keystrokeActionLabels,
  this.keystrokeShortcuts,
  this.includeDefaultKeystrokeShortcuts = true,
  this.onKeystrokeEvent,
  this.keystrokeFocusNode,
  this.keystrokeRequestFocusOnInit = true,
  this.shouldPauseKeystrokes,
  this.keystrokeHudBuilder,
  this.keystrokeHudDuration = const Duration(seconds: 1),
})  : assert(rowCount >= 0, 'rowCount must be >= 0'),
      assert(columnCount >= 0, 'columnCount must be >= 0'),
      assert(rowHeaderWidth >= 0, 'rowHeaderWidth must be >= 0'),
      assert(headerHeight >= 0, 'headerHeight must be >= 0');