YmSearchBar class

有圆角和图标的搜索框

Inheritance

Constructors

YmSearchBar({String text = "", String hint = "搜索", double borderRadius = 30.0, EdgeInsets margin = const EdgeInsets.only(top: 10.0, bottom: 10.0), EdgeInsets padding = const EdgeInsets.only(left: 12), Color splashColor = const Color(0xFFD6D6D6), FocusNode? focusNode, TextEditingController? controller, dynamic onSubmitted(String text)?, dynamic onChanged(String text)?, dynamic onBackCallback()?, Function? clearCallback, int inputKeyWordsLength = 20, double fontSize = 14, bool isShowBackButton = false, double width = 200, double height = 60})

Properties

borderRadius double
搜索框的圆角
getter/setter pair
clearCallback Function?
清楚搜索回调
getter/setter pair
controller TextEditingController?
文本输入框控制器
getter/setter pair
focusNode FocusNode?
文本输入框焦点控制
getter/setter pair
fontSize double
输入框文字大小
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
height double
搜索框的高度
getter/setter pair
hint String
搜索框上显示的文案
getter/setter pair
inputKeyWordsLength int
输入文本的长度限制
getter/setter pair
isShowBackButton bool
是否显示左侧的返回键
getter/setter pair
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsets
getter/setter pair
onBackCallback ↔ (dynamic Function()?)
返回键的回调
getter/setter pair
onChanged ↔ (dynamic Function(String text)?)
getter/setter pair
onSubmitted ↔ (dynamic Function(String text)?)
点击键盘上的回车键的回调
getter/setter pair
padding EdgeInsets
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
splashColor Color
如果考虑不需要水波纹效果那么就可以设置颜色为透明色
getter/setter pair
text String
搜索框上默认的文本
getter/setter pair
width double
搜索框的长度
getter/setter pair

Methods

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