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. Widget sortArrowBuilder(
    1. bool ascending,
    2. bool sorted
    )?,
  10. bool sortArrowAlwaysVisible = false,
  11. ValueSetter<bool?>? onSelectAll,
  12. TextStyle? dataTextStyle,
  13. double dataRowHeight = kMinInteractiveDimension,
  14. CheckboxThemeData? datarowCheckboxTheme,
  15. TextStyle? headingTextStyle,
  16. double headingRowHeight = 56.0,
  17. MaterialStateProperty<Color?>? headingRowColor,
  18. CheckboxThemeData? headingCheckboxTheme,
  19. double horizontalMargin = 24.0,
  20. double columnSpacing = 56.0,
  21. double? dividerThickness,
  22. bool renderEmptyRowsInTheEnd = true,
  23. int fixedLeftColumns = 0,
  24. int fixedTopRows = 1,
  25. Color? fixedColumnsColor,
  26. Color? fixedCornerColor,
  27. bool showCheckboxColumn = true,
  28. bool showFirstLastButtons = false,
  29. int? initialFirstRowIndex = 0,
  30. ValueChanged<int>? onPageChanged,
  31. int rowsPerPage = defaultRowsPerPage,
  32. List<int> availableRowsPerPage = const <int>[defaultRowsPerPage, defaultRowsPerPage * 2, defaultRowsPerPage * 5, defaultRowsPerPage * 10],
  33. ValueChanged<int?>? onRowsPerPageChanged,
  34. DragStartBehavior dragStartBehavior = DragStartBehavior.start,
  35. required DataTableSource source,
  36. double? checkboxHorizontalMargin,
  37. Alignment checkboxAlignment = Alignment.center,
  38. bool wrapInCard = true,
  39. double? minWidth,
  40. FlexFit fit = FlexFit.tight,
  41. bool hidePaginator = false,
  42. PaginatorController? controller,
  43. ScrollController? scrollController,
  44. ScrollController? horizontalScrollController,
  45. bool? isHorizontalScrollBarVisible = false,
  46. bool? isLoadingBarShown = false,
  47. Widget? empty,
  48. TableBorder? border,
  49. bool autoRowsToHeight = false,
  50. double smRatio = 0.67,
  51. double lmRatio = 1.2,
  52. BoxDecoration? headingRowDecoration,
})

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.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.isHorizontalScrollBarVisible = false,
  this.isLoadingBarShown = false,
  this.empty,
  this.border,
  this.autoRowsToHeight = false,
  this.smRatio = 0.67,
  this.lmRatio = 1.2,
  this.headingRowDecoration,
})  : 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;
      }());