Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Rename PaginatedCubitLayout parameters #40

Merged
merged 1 commit into from
Nov 12, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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