SpreadsheetTable constructor

const SpreadsheetTable({
  1. Key? key,
  2. required List<SpreadsheetRow> initialData,
  3. required List<String> headers,
  4. ValueChanged<List<SpreadsheetRow>>? onDataChanged,
  5. ValueChanged<SpreadsheetRow>? onRowDataChanged,
  6. VoidCallback? onNewRowAdded,
  7. ValueChanged<SpreadsheetRow>? onRowDismissed,
  8. SpreadsheetButtonBuilder? leadingButtonBuilder,
  9. SpreadsheetButtonBuilder? trailingButtonBuilder,
  10. EdgeInsetsGeometry cellContentPadding = const EdgeInsets.symmetric(horizontal: 10.0, vertical: 8.0),
  11. bool zebraStripe = false,
  12. List<Color> stripeColors = const [Colors.white, Color(0xFFF5F5F5)],
  13. bool autoLeadingSN = false,
  14. Map<String, TextAlign> columnAlignments = const {},
  15. Map<String, List<String>> dropdownOptions = const {},
  16. Map<String, CellValidator> validators = const {},
})

Implementation

const SpreadsheetTable(
    {super.key,
    required this.initialData,
    required this.headers,
    this.onDataChanged,
    this.onRowDataChanged,
    this.onNewRowAdded,
    this.onRowDismissed,
    this.leadingButtonBuilder,
    this.trailingButtonBuilder,
    this.cellContentPadding =
        const EdgeInsets.symmetric(horizontal: 10.0, vertical: 8.0),
    this.zebraStripe = false,
    this.stripeColors = const [Colors.white, Color(0xFFF5F5F5)],
    this.autoLeadingSN = false,
    this.columnAlignments = const {},
    this.dropdownOptions = const {},
    this.validators = const {}})
    : assert(stripeColors.length == 2,
          'stripeColors must contain exactly two colors if zebraStripe is true');