FSearch class

FSearch 用于处理搜索模块。支持边框、边角、背景等诸多配置效果。支持不同风格的多 hint 切换动画。

FSearch is used to process the search module. Support many configuration effects such as border, corner, background and so on. Support multiple hint switching animations of different styles.

Inheritance

Constructors

FSearch({Key? key, String? text, double? width, double? height, FSearchCorner? corner, Color? strokeColor, double? strokeWidth, FSearchCornerStyle cornerStyle = FSearchCornerStyle.round, Color? backgroundColor, Gradient? gradient, double? shadowBlur, Color? shadowColor, Offset? shadowOffset, Color? cursorColor, double? cursorWidth = 2.0, double? cursorRadius = 0.0, TextStyle? style, TextStyle? hintStyle, List<Widget>? prefixes, List<Widget>? suffixes, EdgeInsets? padding = EdgeInsets.zero, EdgeInsets? margin, List<String>? hints, Duration hintSwitchDuration = const Duration(milliseconds: 3000), Duration hintSwitchAnimDuration = const Duration(milliseconds: 800), bool hintSwitchEnable = false, bool center = false, bool? stopHintSwitchOnFocus = true, Widget? hintPrefix, FSearchController? controller, FSearchAnimationType? hintSwitchType = FSearchAnimationType.Scroll, ValueChanged<String>? onSearch, bool enable = true, VoidCallback? onTap})

Properties

backgroundColor Color?
背景颜色
final
center bool
是否居中。
final
controller FSearchController?
控制器。详见 FSearchController
final
corner FSearchCorner?
边角效果。详见 FSearchCorner
final
cornerStyle FSearchCornerStyle
边角风格。默认 FSearchCornerStyle.round。详见 FSearchCornerStyle
final
cursorColor Color?
光标颜色
final
cursorRadius double?
光标边角大小
final
cursorWidth double?
光标宽
final
enable bool
是否可用
final
gradient Gradient?
背景渐变色。会覆盖 backgroundColor
final
hashCode int
The hash code for this object.
no setterinherited
height double?
final
hintPrefix Widget?
Hint 前缀小部件
final
hints List<String>?
Hint。如果只有一条 Hint,将无法启用 Hint 交换动画。
final
hintStyle TextStyle?
Hint 文本风格
final
hintSwitchAnimDuration Duration
Hint 交换动画时间
final
hintSwitchDuration Duration
Hint 交换时间间隔
final
hintSwitchEnable bool
是否启用 Hint 交换动画
final
hintSwitchType FSearchAnimationType?
Hint 交换动画类型。默认 FSearchAnimationType.Scroll。详见 FSearchAnimationType
final
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
margin EdgeInsets?
FSearch 的外间距
final
onSearch ValueChanged<String>?
当点击键盘搜索按钮时会回调
final
onTap VoidCallback?
当输入框被点击时会回调
final
padding EdgeInsets?
实际输入区域与 FSearch 边缘的间距
final
prefixes List<Widget>?
前缀动作按钮
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
shadowBlur double?
设置组件高斯与阴影形状卷积的标准偏差。
final
shadowColor Color?
设置组件阴影颜色
final
shadowOffset Offset?
设置组件阴影偏移
final
stopHintSwitchOnFocus bool?
当获得焦点时,是否自动停止 Hint 交换动画。默认 true。
final
strokeColor Color?
边框颜色
final
strokeWidth double?
边框宽
final
style TextStyle?
输入文本风格
final
suffixes List<Widget>?
后缀动作按钮
final
text String?
输入内容
final
width double?
宽。
final

Methods

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