OptimizedSearchField class

A widget that provides an optimized search field with dropdown options.

Inheritance

Constructors

OptimizedSearchField.new({required void onChanged(String text)?, required String? labelText, required List<String> dropDownList, required Widget fieldSuffixIcon({required bool menuOpened, required VoidCallback onCloseIconTap, required VoidCallback onlyCloseMenu})?, ButtonStyle? itemStyle, EdgeInsets listPadding = const EdgeInsets.symmetric(vertical: 16), double? itemsSpace, double menuMaxHeight = 400, EdgeInsets menuMargin = const EdgeInsets.only(top: 4, bottom: 8), BoxDecoration? menuDecoration, Clip listClipBehavior = Clip.hardEdge, Key? key, TextStyle? itemTextStyle, Key? textFieldKey, bool? showErrorText, String? errorText, TextEditingController? controller, FocusNode? focusNode, String? description, bool? isRequired, Widget customTextField({required TextEditingController controller, required FocusNode focusNode, required GlobalKey<State<StatefulWidget>> key, required void onChanged(String)?, required void onSubmitted(String)?, required Widget? suffixIcon, required Key? textFieldKey})?, InputDecoration? fieldDecoration, List<TextInputFormatter>? fieldInputFormatters, Iterable<String> optionsBuilder(TextEditingValue)?, TextStyle? labelTextStyle, TextEditingValue? initValue, Widget listItem({required int index, required bool isEnabled, required Key? key, required void onPressed(), required String value})?, Key? listKey, Key? listItemKey, double? listCacheExtent, bool listAddSemanticIndexes = true, ScrollController? listController, String? listRestorationId, int? listSemanticChildCount, DragStartBehavior listDragStartBehavior = DragStartBehavior.start, ScrollPhysics? listPhysics, bool? listPrimary, Key? fieldIconKey, Widget menuList({required Widget item(int index), required int length})?})
const

Properties

controller TextEditingController?
Controller for the search field
final
customTextField Widget Function({required TextEditingController controller, required FocusNode focusNode, required GlobalKey<State<StatefulWidget>> key, required void onChanged(String)?, required void onSubmitted(String)?, required Widget? suffixIcon, required Key? textFieldKey})?
Custom text field widget
final
description String?
Description for the search field
final
List of dropdown items
final
errorText String?
Error text for the search field
final
fieldDecoration InputDecoration?
Decoration for the search field
final
fieldIconKey Key?
final
fieldInputFormatters List<TextInputFormatter>?
Input formatters for the search field
final
fieldSuffixIcon Widget Function({required bool menuOpened, required VoidCallback onCloseIconTap, required VoidCallback onlyCloseMenu})?
Suffix icon for the search field
final
focusNode FocusNode?
Focus node for the search field
final
hashCode int
The hash code for this object.
no setterinherited
initValue TextEditingValue?
Initial value for the text field
final
isRequired bool?
Whether the search field is required
final
itemsSpace double?
Space between items in the list
final
itemStyle ButtonStyle?
Style for the items
final
itemTextStyle TextStyle?
Style for the dropdown items
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
labelText String?
Label text for the search field
final
labelTextStyle TextStyle?
Style for the label text
final
listAddSemanticIndexes bool
final
listCacheExtent double?
final
listClipBehavior Clip
Clip behavior for the list
final
listController ScrollController?
final
listDragStartBehavior DragStartBehavior
final
listItem Widget Function({required int index, required bool isEnabled, required Key? key, required void onPressed(), required String value})?
Custom list item widget
final
listItemKey Key?
final
listKey Key?
final
listPadding EdgeInsets
Padding for the list inside the menu
final
listPhysics ScrollPhysics?
final
listPrimary bool?
final
listRestorationId String?
final
listSemanticChildCount int?
final
Decoration for the menu
final
Custom list widget
final
Margin for the menu
final
Maximum height for the menu
final
onChanged → void Function(String text)?
Callback for text change
final
optionsBuilder Iterable<String> Function(TextEditingValue)?
Options builder for the search field
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showErrorText bool?
Whether to show the error text
final
textFieldKey Key?
Key for the text field
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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