Skip to content

Commit

Permalink
Rename PaginatedCubitLayout parameters
Browse files Browse the repository at this point in the history
  • Loading branch information
Xezolpl committed Nov 11, 2024
1 parent edf76d2 commit 6eb690b
Showing 1 changed file with 8 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -38,8 +38,8 @@ class PaginatedCubitLayout<TData, TItem> extends StatelessWidget {
this.physics,
this.controller,
this.separatorBuilder,
this.headerBuilder,
this.footerBuilder,
this.headerSliverBuilder,
this.footerSliverBuilder,
this.initialStateBuilder,
this.emptyStateBuilder,
this.firstPageLoadingBuilder,
Expand All @@ -64,10 +64,10 @@ class PaginatedCubitLayout<TData, TItem> extends StatelessWidget {
final IndexedWidgetBuilder? separatorBuilder;

/// An optional builder for the header.
final PaginatedWidgetBuilder<TData, TItem>? headerBuilder;
final PaginatedWidgetBuilder<TData, TItem>? headerSliverBuilder;

/// An optional builder for the footer.
final PaginatedWidgetBuilder<TData, TItem>? footerBuilder;
final PaginatedWidgetBuilder<TData, TItem>? footerSliverBuilder;

/// An optional builder for the initial state.
final PaginatedWidgetBuilder<TData, TItem>? initialStateBuilder;
Expand All @@ -93,7 +93,8 @@ class PaginatedCubitLayout<TData, TItem> extends StatelessWidget {
controller: controller,
physics: physics,
slivers: [
if (headerBuilder != null) headerBuilder!(context, cubit.state),
if (headerSliverBuilder != null)
headerSliverBuilder!(context, cubit.state),
BlocBuilder<PaginatedCubit<TData, dynamic, dynamic, TItem>,
PaginatedState<TData, TItem>>(
bloc: cubit,
Expand All @@ -118,7 +119,8 @@ class PaginatedCubitLayout<TData, TItem> extends StatelessWidget {
};
},
),
if (footerBuilder != null) footerBuilder!(context, cubit.state),
if (footerSliverBuilder != null)
footerSliverBuilder!(context, cubit.state),
],
);
}
Expand Down

0 comments on commit 6eb690b

Please sign in to comment.