ZwapSelect class

custom dropdown widget to select some element from a list

Inheritance

Constructors

ZwapSelect({Key? key, required Map<String, String> values, required dynamic callBackFunction(String key, List<String>? allSelectedValues), required String translateText(String key), String? selected, String hintText = '', bool canAddItem = false, dynamic onAddItem(String newItem)?, bool canSearch = false, double? maxOverlayHeight, String? label, Future<Map<String, String>> fetchMoreData(String inputValue, int pageNumber)?, int initialPageNumber = 1, Duration betweenFetchDuration = const Duration(milliseconds: 800), Duration onEmptyResponseDuration = const Duration(seconds: 10), TextStyle? hintTextStyle, double borderRadius = 8, ZwapSelectSearchTypes searchType = ZwapSelectSearchTypes.dynamic, Duration? searchDelayDuration, ItemBuilder? itemBuilder, String? dynamicLabel, bool error = false, String? errorText, Color? backgroundColor, Color? borderColor})
Regular ZwapSelect
ZwapSelect.multiple({Key? key, required Map<String, String> values, required dynamic callBackFunction(String key, List<String>? allSelectedValues), required String translateText(String key), Duration betweenFetchDuration = const Duration(milliseconds: 800), Duration onEmptyResponseDuration = const Duration(seconds: 10), List<String> selectedValues = const [], String hintText = '', bool canAddItem = false, dynamic onAddItem(String newItem)?, bool canSearch = false, double? maxOverlayHeight, String? label, Future<Map<String, String>> fetchMoreData(String inputValue, int pageNumber)?, int initialPageNumber = 1, TextStyle? hintTextStyle, double borderRadius = 8, ZwapSelectSearchTypes searchType = ZwapSelectSearchTypes.dynamic, Duration? searchDelayDuration, ItemBuilder? itemBuilder, bool error = false, String? errorText, Color? backgroundColor, Color? borderColor})
Multiple ZwapSelect, multiple items will be displayed with ZwapTags
ZwapSelect.multipleWithCategories({Key? key, required Map<String, Map<String, String>> valuesByCategory, required dynamic callBackFunction(String key, List<String>? allSelectedValues), required String translateText(String key), List<String> selectedValues = const [], Duration betweenFetchDuration = const Duration(milliseconds: 800), Duration onEmptyResponseDuration = const Duration(seconds: 10), String hintText = '', bool canAddItem = false, dynamic onAddItem(String newItem)?, bool canSearch = false, double? maxOverlayHeight, String? label, Future<Map<String, String>> fetchMoreData(String inputValue, int pageNumber)?, int initialPageNumber = 1, TextStyle? hintTextStyle, double borderRadius = 8, ZwapSelectSearchTypes searchType = ZwapSelectSearchTypes.dynamic, Duration? searchDelayDuration, bool error = false, String? errorText, Color? backgroundColor, Color? borderColor})
ZwapSelect.withCategories({Key? key, required Map<String, Map<String, String>> valuesByCategory, required dynamic callBackFunction(String key, List<String>? allSelectedValues), required String translateText(String key), String? selected, String hintText = '', bool canAddItem = false, dynamic onAddItem(String newItem)?, bool canSearch = false, double? maxOverlayHeight, String? label, Future<Map<String, String>> fetchMoreData(String inputValue, int pageNumber)?, Duration betweenFetchDuration = const Duration(milliseconds: 800), Duration onEmptyResponseDuration = const Duration(seconds: 10), int initialPageNumber = 1, TextStyle? hintTextStyle, double borderRadius = 8, Duration? searchDelayDuration, ZwapSelectSearchTypes searchType = ZwapSelectSearchTypes.dynamic, ItemBuilder? itemBuilder, String? dynamicLabel, bool error = false, String? errorText, Color? backgroundColor, Color? borderColor})

Properties

backgroundColor Color?
final
betweenFetchDuration Duration
Used to wait a delay between the fetchMoreData callbacks
final
borderColor Color?
final
borderRadius double
final
callBackFunction → dynamic Function(String key, List<String>? allSelectedValues)
It handles the selected value with a callBack function
final
canAddItem bool
If true user can add new values
final
canSearch bool
If true user can type and filter items
final
dynamicLabel String?
final
error bool
If true the error stete decorations will be used
final
errorText String?
If provided this string will be showed under the select widget when error is true
final
fetchMoreData → (Future<Map<String, String>> Function(String inputValue, int pageNumber)?)
If not null and user scrolls to the end this function will be called and new items will be automatically added
final
hashCode int
The hash code for this object.
no setterinherited
hintText String
Text to display if there is no selected value
final
hintTextStyle TextStyle?
The hintText text style
final
initialPageNumber int
The initial page number used for call fetchMoreData callback
final
isMultiple bool
no setter
isRegular bool
no setter
itemBuilder ItemBuilder?
If provided this function will be called:
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
label String?
If not null a label will be displayed with this value
final
maxOverlayHeight double?
The select overlay mac height
final
onAddItem → (dynamic Function(String newItem)?)
Called only if canAddItem is true when user click add new item
final
onEmptyResponseDuration Duration
Used to wait a delay between the fetchMoreData callbacks if one reply with empty responses
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchDelayDuration Duration?
If provided, the same duration is waited before the search callback is called
final
searchType ZwapSelectSearchTypes
final
selected String?
The current value of select input, if is regular select
final
selectedValues List<String>
The current selected item keys, if multiple select
final
translateText String Function(String key)
Should return the translated text in base of the current locale
final
values Map<String, String>
The custom values to display inside this widget
final
valuesByCategory Map<String, Map<String, String>>
The custom values to display inside this widget, divided by category
final

Methods

createElement() StatefulElement
Creates a StatefulElement to manage this widget's location in the tree.
inherited
createState() → _ZwapSelectState
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