PaginatedSearchBar<T> class

Inheritance

Constructors

PaginatedSearchBar({required Widget itemBuilder(BuildContext context, {required int index, required T item}), required Future<List<T>> onSearch({required int pageIndex, required int pageSize, required String searchQuery}), BoxDecoration? containerDecoration, PaginatedSearchBarStyleStateProperty<BoxDecoration>? containerDecorationState, TextStyle? inputStyle, PaginatedSearchBarStyleStateProperty<TextStyle>? inputStyleState, InputDecoration? inputDecoration, PaginatedSearchBarStyleStateProperty<InputDecoration>? inputDecorationState, String? hintText, Widget spacerBuilder(BuildContext context)?, PaginatedSearchBarBuilderStateProperty? spacerBuilderState, Widget headerBuilder(BuildContext context)?, PaginatedSearchBarBuilderStateProperty? headerBuilderState, Widget emptyBuilder(BuildContext context)?, PaginatedSearchBarBuilderStateProperty? emptyBuilderState, Widget placeholderBuilder(BuildContext context)?, PaginatedSearchBarBuilderStateProperty? placeholderBuilderState, Widget footerBuilder(BuildContext context)?, PaginatedSearchBarBuilderStateProperty? footerBuilderState, Widget loadingBuilder(BuildContext context)?, PaginatedSearchBarBuilderStateProperty? loadingBuilderState, double? maxHeight, EndlessPaginationDelegate? paginationDelegate, EndlessPaginationController<T>? listController, void onSubmit({required T? item, required String searchQuery})?, TextEditingController? inputController, EdgeInsets? padding = const EdgeInsets.all(16), double itemPadding = 16, Duration? searchDebounceDuration = const Duration(milliseconds: 200), bool autoFocus = false, int minSearchLength = 3, Duration? resizeDuration = const Duration(milliseconds: 250), dynamic key})
const

Properties

autoFocus bool
Whether to initially focus the search bar.
final
containerDecoration BoxDecoration?
The decoration of the container around the entire search bar and results list.
final
containerDecorationState PaginatedSearchBarStyleStateProperty<BoxDecoration>?
The StateProperty for customizing the decoration of the container around the entire search bar and results list based on the active set of PaginatedSearchBarState states.
final
emptyBuilder → (Widget Function(BuildContext context)?)
The builder for the empty state shown when no items are returned from a search.
final
emptyBuilderState PaginatedSearchBarBuilderStateProperty?
The state property for customizing the building of the empty state shown when no items are returned from a search based on the active set of PaginatedSearchBarState states.
final
footerBuilder → (Widget Function(BuildContext context)?)
The builder for the footer below above the search results list.
final
footerBuilderState PaginatedSearchBarBuilderStateProperty?
The state property for building the footer shown below the search results list based on the active set of PaginatedSearchBarState states.
final
hashCode int
The hash code for this object.
no setterinherited
headerBuilder → (Widget Function(BuildContext context)?)
The builder for the header shown above the search results list.
final
headerBuilderState PaginatedSearchBarBuilderStateProperty?
The state property for building the header shown above the search results list based on the active set of PaginatedSearchBarState states.
final
hintText String?
The hint text to show in the TextFormField.
final
inputController TextEditingController?
The text controller for the search bar.
final
inputDecoration InputDecoration?
final
inputDecorationState PaginatedSearchBarStyleStateProperty<InputDecoration>?
The StateProperty for customizing the decoration of the search bar input based on the active set of PaginatedSearchBarState states.
final
inputStyle TextStyle?
The style for the text in the search bar input.
final
inputStyleState PaginatedSearchBarStyleStateProperty<TextStyle>?
The StateProperty for customizing the style of the text in the search bar input based on the active set of PaginatedSearchBarState states.
final
itemBuilder Widget Function(BuildContext context, {required int index, required T item})
The builder for the items in the search results list.
final
itemPadding double
The padding value to display between each item.
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
listController → EndlessPaginationController<T>?
The pagination controller for manipulating the list of search results using the EndlessPaginationListView.
final
loadingBuilder → (Widget Function(BuildContext context)?)
The builder for the loader shown when the user pages down the search results list.
final
loadingBuilderState PaginatedSearchBarBuilderStateProperty?
The state property for customizing the building of the loader shown when the user pages down the search results list based on the active set of PaginatedSearchBarState states.
final
maxHeight double?
The maximum height of the container for search bar and results.
final
minSearchLength int
The minimum search length before searching.
final
onSearch Future<List<T>> Function({required int pageIndex, required int pageSize, required String searchQuery})
The search function to perform when the user types into the search bar. Returns a list of items to display in the search results list.
final
onSubmit → (void Function({required T? item, required String searchQuery})?)
The handler for when a user submits the search bar input field by hitting enter. Provides the top item from the current of search results if it exists as the chosen result.
final
padding EdgeInsets?
The padding to display around the container of search results.
final
paginationDelegate → EndlessPaginationDelegate?
The pagination delegate for specifying page size and the maximum number of pages to load in the results list using the EndlessPaginationListView.
final
placeholderBuilder → (Widget Function(BuildContext context)?)
The builder for the placeholder shown before any results have been searched for.
final
placeholderBuilderState PaginatedSearchBarBuilderStateProperty?
The state property for customizing the building of the placeholder shown when before any results have been searched for based on the active set of PaginatedSearchBarState states.
final
resizeDuration Duration?
The duration for animating the size of the results container provided to the AnimatedSize widget.
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchDebounceDuration Duration?
The duration for debouncing search when the user types in the search bar.
final
spacerBuilder → (Widget Function(BuildContext context)?)
The builder for the spacer shown between the search bar input and results list. Defaults to a LineSpacer.
final
spacerBuilderState PaginatedSearchBarBuilderStateProperty?
The state property for building the spacer shown between the search bar input and results list based on the active set of PaginatedSearchBarState states.
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _PaginatedSearchBarState<T>
Creates the mutable state for this widget at a given location in the tree.
override
debugDescribeChildren() List<DiagnosticsNode>
Returns a list of DiagnosticsNode objects describing this node's children.
inherited
debugFillProperties(DiagnosticPropertiesBuilder properties) → void
Add additional properties associated with the node.
inherited
noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toDiagnosticsNode({String? name, DiagnosticsTreeStyle? style}) DiagnosticsNode
Returns a debug representation of the object that is used by debugging tools and by DiagnosticsNode.toStringDeep.
inherited
toString({DiagnosticLevel minLevel = DiagnosticLevel.info}) String
A string representation of this object.
inherited
toStringDeep({String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a string representation of this node and its descendants.
inherited
toStringShallow({String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) String
Returns a one-line detailed description of the object.
inherited
toStringShort() String
A short, textual description of this widget.
inherited

Operators

operator ==(Object other) bool
The equality operator.
inherited