BrnSearchText class

基本IOS风格搜索框, 提供输入回调

Inheritance
Available Extensions

Constructors

BrnSearchText({Key? key, BrnSearchTextController? searchController, TextEditingController? controller, int maxLines = 1, int? maxLength, String? hintText, TextStyle? hintStyle, TextStyle? textStyle, Widget? prefixIcon, BrnOnSearchTextChange? onTextChange, BrnOnCommit? onTextCommit, BrnOnTextClear? onTextClear, VoidCallback? onActionTap, Widget? action, double maxHeight = 60, EdgeInsets innerPadding = const EdgeInsets.only(top: 10, bottom: 10, left: 20, right: 20), Color outSideColor = Colors.white, Color innerColor = const Color(0xfff8f8f8), BoxBorder? normalBorder, BoxBorder? activeBorder, BorderRadius borderRadius = const BorderRadius.all(const Radius.circular(6.0)), FocusNode? focusNode, bool autoFocus = false, TextInputAction? textInputAction, List<TextInputFormatter>? inputFormatters, TextInputType? textInputType})
const

Properties

action Widget?
右侧操作 widget
final
activeBorder BoxBorder?
激活状态的 Border, 默认和 border 一致
final
autoFocus bool
是否自动获取焦点
final
borderRadius BorderRadius
输入框圆角
final
controller TextEditingController?
final
focusNode FocusNode?
final
hashCode int
The hash code for this object.
no setterinherited
hintStyle TextStyle?
提示语样式
final
hintText String?
提示语
final
innerColor Color
搜索框内部的颜色
final
innerPadding EdgeInsets
内部搜索框之外的 Padding。设置该字段会导致显示区域变小。
final
inputFormatters List<TextInputFormatter>?
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
maxHeight double
输入框最大高度,默认 60
final
maxLength int?
最大输入长度
final
maxLines int
最大展示行数
final
normalBorder BoxBorder?
普通状态的 border
final
onActionTap VoidCallback?
右侧 action 区域点击的回调
final
onTextChange BrnOnSearchTextChange?
文本变化的回调
final
onTextClear BrnOnTextClear?
清除按钮的回调 如果用户设置了该属性 如果返回值为true,表明用户想要拦截,则不会走默认的清除行为 如果返回值为false,表明用户不想要拦截,在执行了用户的行为之后,还会走默认的行为
final
onTextCommit BrnOnCommit?
提交文本时的回调
final
outSideColor Color
包裹搜索框的容器背景色
final
prefixIcon Widget?
用于设置搜索框前端的 Icon
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
searchController BrnSearchTextController?
用于控制清除 Icon 和右侧 Action 的显示与隐藏。等其他复杂的操作。
final
textInputAction TextInputAction?
用于控制键盘动作
final
textInputType TextInputType?
final
textStyle TextStyle?
输入框样式
final

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