ClassicHeader class

经典头部刷新指示器

这是最常用的刷新指示器,结合了文本和图标,支持多种刷新状态

主要功能:

  • 支持多种刷新状态显示(空闲、可刷新、刷新中、完成、失败、二级刷新)
  • 可自定义文本、图标、间距和位置
  • 支持国际化文本
  • 支持外部容器自定义

示例用法:

ClassicHeader(
  idleText: "下拉刷新",
  releaseText: "释放刷新",
  refreshingText: "刷新中...",
  completeText: "刷新完成",
  failedText: "刷新失败",
  iconPos: IconPosition.left,
  spacing: 10.0,
)

相关组件:

Inheritance

Constructors

ClassicHeader({Key? key, RefreshStyle refreshStyle = RefreshStyle.follow, double height = 60.0, Duration completeDuration = const Duration(milliseconds: 600), OuterBuilder? outerBuilder, TextStyle textStyle = const TextStyle(color: Colors.grey), String? releaseText, String? refreshingText, String? completeText, String? failedText, String? idleText, IconPosition iconPos = IconPosition.left, double spacing = 15.0, Widget? refreshingIcon, Widget? failedIcon = const Icon(Icons.error, color: Colors.grey), Widget? completeIcon = const Icon(Icons.done, color: Colors.grey), Widget? idleIcon = const Icon(Icons.arrow_downward, color: Colors.grey), Widget? releaseIcon = const Icon(Icons.refresh, color: Colors.grey)})
const

Properties

completeDuration → Duration
刷新完成或失败时的停留时间
finalinherited
completeIcon → Widget?
刷新状态图标配置
final
completeText → String?
刷新状态文本配置
final
failedIcon → Widget?
刷新状态图标配置
final
failedText → String?
刷新状态文本配置
final
hashCode → int
The hash code for this object.
no setterinherited
height → double
指示器的视觉高度
finalinherited
iconPos → IconPosition
图标相对于文本的位置
final
idleIcon → Widget?
刷新状态图标配置
final
idleText → String?
刷新状态文本配置
final
key → Key?
Controls how one widget replaces another widget in the tree.
finalinherited
offset → double
布局偏移量
finalinherited
outerBuilder → OuterBuilder?
外部包装构建器
final
refreshingIcon → Widget?
刷新状态图标配置
final
refreshingText → String?
刷新状态文本配置
final
refreshStyle → RefreshStyle
刷新显示样式
finalinherited
releaseIcon → Widget?
刷新状态图标配置
final
releaseText → String?
刷新状态文本配置
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
spacing → double
图标和文本之间的间距
final
textStyle → TextStyle
文本样式
final

Methods

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