PaginatedDataTable2 constructor

PaginatedDataTable2({
  1. Key? key,
  2. Widget? header,
  3. List<Widget>? actions,
  4. required List<DataColumn> columns,
  5. int? sortColumnIndex,
  6. bool sortAscending = true,
  7. Duration sortArrowAnimationDuration = const Duration(milliseconds: 150),
  8. IconData sortArrowIcon = Icons.arrow_upward,
  9. Color? sortArrowIconColor,
  10. Widget sortArrowBuilder(
    1. bool ascending,
    2. bool sorted
    )?,
  11. bool sortArrowAlwaysVisible = false,
  12. ValueSetter<bool?>? onSelectAll,
  13. TextStyle? dataTextStyle,
  14. double dataRowHeight = kMinInteractiveDimension,
  15. CheckboxThemeData? datarowCheckboxTheme,
  16. TextStyle? headingTextStyle,
  17. double headingRowHeight = 56.0,
  18. WidgetStateProperty<Color?>? headingRowColor,
  19. CheckboxThemeData? headingCheckboxTheme,
  20. double horizontalMargin = 24.0,
  21. double columnSpacing = 56.0,
  22. double? dividerThickness,
  23. bool renderEmptyRowsInTheEnd = true,
  24. int fixedLeftColumns = 0,
  25. int fixedTopRows = 1,
  26. Color? fixedColumnsColor,
  27. Color? fixedCornerColor,
  28. bool showCheckboxColumn = true,
  29. bool showFirstLastButtons = false,
  30. int? initialFirstRowIndex = 0,
  31. ValueChanged<int>? onPageChanged,
  32. int rowsPerPage = defaultRowsPerPage,
  33. List<int> availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10],
  34. ValueChanged<int?>? onRowsPerPageChanged,
  35. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  36. required DataTableSource source,
  37. double? checkboxHorizontalMargin,
  38. Alignment checkboxAlignment = Alignment.center,
  39. bool wrapInCard = true,
  40. double? minWidth,
  41. FlexFit fit = FlexFit.tight,
  42. bool hidePaginator = false,
  43. PaginatorController? controller,
  44. ScrollController? scrollController,
  45. ScrollController? horizontalScrollController,
  46. Widget? empty,
  47. TableBorder? border,
  48. bool autoRowsToHeight = false,
  49. double smRatio = 0.67,
  50. double lmRatio = 1.2,
  51. BoxDecoration? headingRowDecoration,
  52. bool? isVerticalScrollBarVisible,
  53. bool? isHorizontalScrollBarVisible,
})

Check out PaginatedDataTable for the API decription. Key differences are minWidth and fit properties.

Implementation

PaginatedDataTable2({
  super.key,
  this.header,
  this.actions,
  required this.columns,
  this.sortColumnIndex,
  this.sortAscending = true,
  this.sortArrowAnimationDuration = const Duration(milliseconds: 150),
  this.sortArrowIcon = Icons.arrow_upward,
  this.sortArrowIconColor,
  this.sortArrowBuilder,
  this.sortArrowAlwaysVisible = false,
  this.onSelectAll,
  this.dataTextStyle,
  this.dataRowHeight = kMinInteractiveDimension,
  this.datarowCheckboxTheme,
  this.headingTextStyle,
  this.headingRowHeight = 56.0,
  this.headingRowColor,
  this.headingCheckboxTheme,
  this.horizontalMargin = 24.0,
  this.columnSpacing = 56.0,
  this.dividerThickness,
  this.renderEmptyRowsInTheEnd = true,
  this.fixedLeftColumns = 0,
  this.fixedTopRows = 1,
  this.fixedColumnsColor,
  this.fixedCornerColor,
  this.showCheckboxColumn = true,
  this.showFirstLastButtons = false,
  this.initialFirstRowIndex = 0,
  this.onPageChanged,
  this.rowsPerPage = defaultRowsPerPage,
  this.availableRowsPerPage = const <int>[
    defaultRowsPerPage,
    defaultRowsPerPage * 2,
    defaultRowsPerPage * 5,
    defaultRowsPerPage * 10
  ],
  this.onRowsPerPageChanged,
  this.dragStartBehavior = DragStartBehavior.start,
  required this.source,
  this.checkboxHorizontalMargin,
  this.checkboxAlignment = Alignment.center,
  this.wrapInCard = true,
  this.minWidth,
  this.fit = FlexFit.tight,
  this.hidePaginator = false,
  this.controller,
  this.scrollController,
  this.horizontalScrollController,
  this.empty,
  this.border,
  this.autoRowsToHeight = false,
  this.smRatio = 0.67,
  this.lmRatio = 1.2,
  this.headingRowDecoration,
  this.isVerticalScrollBarVisible,
  this.isHorizontalScrollBarVisible,
})  : assert(actions == null || (header != null)),
      assert(columns.isNotEmpty),
      assert(sortColumnIndex == null ||
          (sortColumnIndex >= 0 && sortColumnIndex < columns.length)),
      assert(rowsPerPage > 0),
      assert(() {
        if (onRowsPerPageChanged != null && autoRowsToHeight == false) {
          assert(availableRowsPerPage.contains(rowsPerPage));
        }
        return true;
      }());