diff --git a/packages/leancode_cubit_utils/lib/src/paginated/paginated_cubit_layout.dart b/packages/leancode_cubit_utils/lib/src/paginated/paginated_cubit_layout.dart index 21c4eec..c5a6cd9 100644 --- a/packages/leancode_cubit_utils/lib/src/paginated/paginated_cubit_layout.dart +++ b/packages/leancode_cubit_utils/lib/src/paginated/paginated_cubit_layout.dart @@ -38,8 +38,8 @@ class PaginatedCubitLayout extends StatelessWidget { this.physics, this.controller, this.separatorBuilder, - this.headerBuilder, - this.footerBuilder, + this.headerSliverBuilder, + this.footerSliverBuilder, this.initialStateBuilder, this.emptyStateBuilder, this.firstPageLoadingBuilder, @@ -64,10 +64,10 @@ class PaginatedCubitLayout extends StatelessWidget { final IndexedWidgetBuilder? separatorBuilder; /// An optional builder for the header. - final PaginatedWidgetBuilder? headerBuilder; + final PaginatedWidgetBuilder? headerSliverBuilder; /// An optional builder for the footer. - final PaginatedWidgetBuilder? footerBuilder; + final PaginatedWidgetBuilder? footerSliverBuilder; /// An optional builder for the initial state. final PaginatedWidgetBuilder? initialStateBuilder; @@ -93,7 +93,8 @@ class PaginatedCubitLayout extends StatelessWidget { controller: controller, physics: physics, slivers: [ - if (headerBuilder != null) headerBuilder!(context, cubit.state), + if (headerSliverBuilder case final headerSliverBuilder?) + headerSliverBuilder(context, cubit.state), BlocBuilder, PaginatedState>( bloc: cubit, @@ -118,7 +119,8 @@ class PaginatedCubitLayout extends StatelessWidget { }; }, ), - if (footerBuilder != null) footerBuilder!(context, cubit.state), + if (footerSliverBuilder case final footerSliverBuilder?) + footerSliverBuilder(context, cubit.state), ], ); }