diff --git a/lib/src/async_paginated_data_table_2.dart b/lib/src/async_paginated_data_table_2.dart index 1d88ec4..1ce3f04 100644 --- a/lib/src/async_paginated_data_table_2.dart +++ b/lib/src/async_paginated_data_table_2.dart @@ -315,65 +315,68 @@ enum PageSyncApproach { doNothing, goToFirst, goToLast } /// of integrating data table with remote back-end and is loaded with /// convenienece features such as error handling, reloading etc. class AsyncPaginatedDataTable2 extends PaginatedDataTable2 { - AsyncPaginatedDataTable2( - {super.key, - super.header, - super.actions, - required super.columns, - super.sortColumnIndex, - super.sortAscending = true, - super.sortArrowAnimationDuration = const Duration(milliseconds: 150), - super.sortArrowIcon = Icons.arrow_upward, - super.sortArrowAlwaysVisible, - super.sortArrowBuilder, - super.onSelectAll, - super.dataRowHeight = kMinInteractiveDimension, - super.headingRowColor, - super.headingRowDecoration, - super.headingRowHeight = 56, - super.headingCheckboxTheme, - super.headingTextStyle, - super.horizontalMargin = 24, - super.columnSpacing = 56, - super.dividerThickness, - super.renderEmptyRowsInTheEnd = true, - super.fixedLeftColumns = 0, - super.fixedTopRows = 1, - super.fixedColumnsColor, - super.fixedCornerColor, - super.datarowCheckboxTheme, - super.dataTextStyle, - super.showCheckboxColumn = true, - super.showFirstLastButtons = false, - super.initialFirstRowIndex = 0, - super.onPageChanged, - super.rowsPerPage = defaultRowsPerPage, - super.availableRowsPerPage = const [ - defaultRowsPerPage, - defaultRowsPerPage * 2, - defaultRowsPerPage * 5, - defaultRowsPerPage * 10 - ], - super.onRowsPerPageChanged, - super.dragStartBehavior = DragStartBehavior.start, - required super.source, - super.checkboxHorizontalMargin, - super.checkboxAlignment, - super.wrapInCard = true, - super.minWidth, - super.fit = FlexFit.tight, - super.hidePaginator = false, - super.controller, - super.scrollController, - super.horizontalScrollController, - super.empty, - this.loading, - this.errorBuilder, - this.pageSyncApproach = PageSyncApproach.doNothing, - super.border, - super.autoRowsToHeight = false, - super.smRatio = 0.67, - super.lmRatio = 1.2}); + AsyncPaginatedDataTable2({ + super.key, + super.header, + super.actions, + required super.columns, + super.sortColumnIndex, + super.sortAscending = true, + super.sortArrowAnimationDuration = const Duration(milliseconds: 150), + super.sortArrowIcon = Icons.arrow_upward, + super.sortArrowAlwaysVisible, + super.sortArrowBuilder, + super.onSelectAll, + super.dataRowHeight = kMinInteractiveDimension, + super.headingRowColor, + super.headingRowDecoration, + super.headingRowHeight = 56, + super.headingCheckboxTheme, + super.headingTextStyle, + super.horizontalMargin = 24, + super.columnSpacing = 56, + super.dividerThickness, + super.renderEmptyRowsInTheEnd = true, + super.fixedLeftColumns = 0, + super.fixedTopRows = 1, + super.fixedColumnsColor, + super.fixedCornerColor, + super.datarowCheckboxTheme, + super.dataTextStyle, + super.showCheckboxColumn = true, + super.showFirstLastButtons = false, + super.initialFirstRowIndex = 0, + super.onPageChanged, + super.rowsPerPage = defaultRowsPerPage, + super.availableRowsPerPage = const [ + defaultRowsPerPage, + defaultRowsPerPage * 2, + defaultRowsPerPage * 5, + defaultRowsPerPage * 10 + ], + super.onRowsPerPageChanged, + super.dragStartBehavior = DragStartBehavior.start, + required super.source, + super.checkboxHorizontalMargin, + super.checkboxAlignment, + super.wrapInCard = true, + super.minWidth, + super.fit = FlexFit.tight, + super.hidePaginator = false, + super.controller, + super.scrollController, + super.horizontalScrollController, + super.empty, + this.loading, + this.errorBuilder, + this.pageSyncApproach = PageSyncApproach.doNothing, + super.border, + super.autoRowsToHeight = false, + super.smRatio = 0.67, + super.lmRatio = 1.2, + super.isHorizontalScrollBarVisible, + super.isVerticalScrollBarVisible, + }); /// Widget that is goin to be displayed while loading is in progress /// If no widget is specified the following defaul widget will be disoplayed: diff --git a/lib/src/paginated_data_table_2.dart b/lib/src/paginated_data_table_2.dart index 5cbc48c..36936c9 100644 --- a/lib/src/paginated_data_table_2.dart +++ b/lib/src/paginated_data_table_2.dart @@ -213,6 +213,8 @@ class PaginatedDataTable2 extends StatefulWidget { 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 || @@ -509,6 +511,12 @@ class PaginatedDataTable2 extends StatefulWidget { /// Exposes scroll controller of the SingleChildScrollView that makes data rows horizontally scrollable final ScrollController? horizontalScrollController; + /// Determines whether the vertical scroll bar is visible, for iOS takes value from scrollbarTheme when null + final bool? isVerticalScrollBarVisible; + + /// Determines whether the horizontal scroll bar is visible, for iOS takes value from scrollbarTheme when null + final bool? isHorizontalScrollBarVisible; + @override PaginatedDataTable2State createState() => PaginatedDataTable2State(); } @@ -797,6 +805,8 @@ class PaginatedDataTable2State extends State { border: widget.border, smRatio: widget.smRatio, lmRatio: widget.lmRatio, + isHorizontalScrollBarVisible: widget.isHorizontalScrollBarVisible, + isVerticalScrollBarVisible: widget.isVerticalScrollBarVisible, ), ), );