Skip to content

Commit

Permalink
Added isHorizontalScrollBarVisible & isVerticalScrollBarVisible for P…
Browse files Browse the repository at this point in the history
…aginatedDataTable2
  • Loading branch information
Tarish committed Feb 21, 2024
1 parent 4d1ac0e commit 5cefd6e
Show file tree
Hide file tree
Showing 2 changed files with 72 additions and 59 deletions.
121 changes: 62 additions & 59 deletions lib/src/async_paginated_data_table_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 <int>[
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 <int>[
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:
Expand Down
10 changes: 10 additions & 0 deletions lib/src/paginated_data_table_2.dart
Original file line number Diff line number Diff line change
Expand Up @@ -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 ||
Expand Down Expand Up @@ -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();
}
Expand Down Expand Up @@ -797,6 +805,8 @@ class PaginatedDataTable2State extends State<PaginatedDataTable2> {
border: widget.border,
smRatio: widget.smRatio,
lmRatio: widget.lmRatio,
isHorizontalScrollBarVisible: widget.isHorizontalScrollBarVisible,
isVerticalScrollBarVisible: widget.isVerticalScrollBarVisible,
),
),
);
Expand Down

0 comments on commit 5cefd6e

Please sign in to comment.