PaginationDropdownList class
Dropdown list with pagination support.
- Loads first page on open
- Loads next page as user scrolls
- Shows a spinner at bottom while fetching more
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- PaginationDropdownList
Constructors
-
PaginationDropdownList({Key? key, required String textTitle, required String hintText, required dynamic onChanged(String?), required String itemParser(dynamic item), String noMoreItemsMessage = "No more items", String errorMessage = "error occurred while fetching data", String noItemMessage = "No items available", bool enabled = true, String? initialItem, bool? isRequired, Future<
List> fetchItems(int page, int pageSize)?, Widget? emptyStateWidget, Widget? errorStateWidget, int pageSize = 10, Color selectedColor = primaryColor}) -
const
Properties
- emptyStateWidget → Widget?
-
Optional widget to display when no items are available
final
- enabled → bool
-
Whether the dropdown list is enabled
final
- errorMessage → String
-
error message
default: "error occurred while fetching data"
final
- errorStateWidget → Widget?
-
Optional widget to display when there's an error
final
-
fetchItems
→ Future<
List> Function(int page, int pageSize)? -
Function that fetches a page of items.
The
pagestarts from 1.final - hashCode → int
-
The hash code for this object.
no setterinherited
- hintText → String
-
Hint text displayed when no item is selected
final
- initialItem → String?
-
Initial selected item
final
- isRequired → bool?
-
Whether the field is required (shows asterisk if true)
final
- itemParser → String Function(dynamic item)
-
Converts raw API item to a displayable string.
Converts raw API item to displayable string
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- noItemMessage → String
-
no Item message
default: "No items available"
final
- noMoreItemsMessage → String
-
no more items message
default: "No more items"
final
- onChanged → dynamic Function(String?)
-
final
- pageSize → int
-
Page size for pagination (default: 10)
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- selectedColor → Color
-
final
- textTitle → String
-
Title text displayed above the dropdown
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< PaginationDropdownList> -
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, int wrapWidth = 65}) → 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
Constants
- greyColor → const Color
- greyLightColor → const Color
- primaryColor → const Color