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. SSpreadsheetSelectionController? selectionController,
  28. Object columnKeyBuilder(
    1. int columnIndex
    )?,
  29. double dimUnselectedOpacity = 1.0,
  30. Duration dimAnimationDuration = const Duration(milliseconds: 250),
  31. bool enableTapToSelectRowHeader = false,
  32. bool enableTapToSelectColumnHeader = false,
  33. Color? rowHeaderTapSplashColor = Colors.transparent,
  34. Color? columnHeaderTapSplashColor = Colors.transparent,
  35. void onRowHeaderSelected(
    1. int rowIndex,
    2. Object? key
    )?,
  36. void onColumnHeaderSelected(
    1. int rowIndex,
    2. Object? key
    )?,
  37. VoidCallback? onSelectionCleared,
  38. void onCellTap(
    1. int rowIndex,
    2. int columnIndex
    )?,
  39. bool enableKeystrokes = false,
  40. bool keystrokeDebugLogs = false,
  41. Map<Type, VoidCallback>? keystrokeActionHandlers,
  42. Map<Type, String>? keystrokeActionLabels,
  43. Map<ShortcutActivator, Intent>? keystrokeShortcuts,
  44. bool includeDefaultKeystrokeShortcuts = true,
  45. void onKeystrokeEvent(
    1. KeyDownEvent
    )?,
  46. FocusNode? keystrokeFocusNode,
  47. bool keystrokeRequestFocusOnInit = true,
  48. bool shouldPauseKeystrokes()?,
  49. SSpreadsheetKeystrokeHudBuilder? keystrokeHudBuilder,
  50. 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),
  // Selection params
  this.selectionController,
  this.columnKeyBuilder,
  this.dimUnselectedOpacity = 1.0,
  this.dimAnimationDuration = const Duration(milliseconds: 250),
  this.enableTapToSelectRowHeader = false,
  this.enableTapToSelectColumnHeader = false,
  this.rowHeaderTapSplashColor = Colors.transparent,
  this.columnHeaderTapSplashColor = Colors.transparent,
  this.onRowHeaderSelected,
  this.onColumnHeaderSelected,
  this.onSelectionCleared,
  this.onCellTap,
  // 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');