Skip to content

Commit

Permalink
Merge pull request #57 from twaflutterpackages/master
Browse files Browse the repository at this point in the history
RefreshIndicator color
  • Loading branch information
vedartm committed Apr 8, 2022
2 parents 72bcef1 + 149d52d commit b11e7fa
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions lib/pagination_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,7 @@ class PaginationView<T> extends StatefulWidget {
required this.onEmpty,
required this.onError,
this.pullToRefresh = false,
this.refreshIndicatorColor = Colors.blue,
this.gridDelegate =
const SliverGridDelegateWithFixedCrossAxisCount(crossAxisCount: 2),
List<T>? preloadedItems,
Expand Down Expand Up @@ -50,6 +51,7 @@ class PaginationView<T> extends StatefulWidget {
final ScrollPhysics? physics;
final List<T> preloadedItems;
final bool pullToRefresh;
final Color refreshIndicatorColor;
final bool reverse;
final ScrollController? scrollController;
final Axis scrollDirection;
Expand Down Expand Up @@ -98,6 +100,7 @@ class PaginationViewState<T> extends State<PaginationView<T>> {
} else if (state is PaginationError<T>) {
if (widget.pullToRefresh) {
return RefreshIndicator(
color: widget.refreshIndicatorColor,
onRefresh: refresh,
child: _buildSingleWidgetView(widget.onError(state.error)),
);
Expand All @@ -109,6 +112,7 @@ class PaginationViewState<T> extends State<PaginationView<T>> {
if (loadedState.items.isEmpty) {
if (widget.pullToRefresh) {
return RefreshIndicator(
color: widget.refreshIndicatorColor,
onRefresh: refresh,
child: _buildSingleWidgetView(widget.onEmpty),
);
Expand All @@ -118,6 +122,7 @@ class PaginationViewState<T> extends State<PaginationView<T>> {
}
if (widget.pullToRefresh) {
return RefreshIndicator(
color: widget.refreshIndicatorColor,
onRefresh: refresh,
child: _buildCustomScrollView(loadedState),
);
Expand Down

0 comments on commit b11e7fa

Please sign in to comment.