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 12, 2024
1 parent edf76d2 commit 4da6f50
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 case final headerSliverBuilder?)
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 case final footerSliverBuilder?)
footerSliverBuilder(context, cubit.state),
],
);
}
Expand Down

0 comments on commit 4da6f50

Please sign in to comment.