resolveHeaderStateProperty function
EndlessStateProperty
resolveHeaderStateProperty({
- required PaginatedSearchBarBuilderStateProperty? headerBuilderState,
- required Widget? headerBuilder(
- BuildContext context
- required Set<
PaginatedSearchBarState> searchBarStates,
By default the paginated search bar will show a border between the search input and the list view when the list view is expanded (the list view either has items, an empty state to show or a placeholder to show).
Implementation
EndlessStateProperty resolveHeaderStateProperty({
required PaginatedSearchBarBuilderStateProperty? headerBuilderState,
required Widget? Function(BuildContext context)? headerBuilder,
required Set<PaginatedSearchBarState> searchBarStates,
}) {
return EndlessStateProperty.resolveWith(
(context, listStates) {
final newSearchBarStates = resolveSearchStates(
listStates: listStates,
isFocused: searchBarStates.contains(PaginatedSearchBarState.focused),
);
if (headerBuilderState != null) {
return headerBuilderState.resolve(
context,
newSearchBarStates,
);
} else if (headerBuilder != null) {
return headerBuilder(context);
}
},
);
}