NZNoticeBar class
NZNoticeBar 公告栏组件。
用于循环播放重要的公告、新闻或提示信息。支持水平和垂直滚动。
- Inheritance
-
- Object
- DiagnosticableTree
- Widget
- StatefulWidget
- NZNoticeBar
Constructors
-
NZNoticeBar({Key? key, required List<
String> text, NZNoticeBarTheme theme = NZNoticeBarTheme.warning, NZNoticeBarDirection direction = NZNoticeBarDirection.horizontal, Widget? icon, Widget? suffix, double speed = 50.0, int duration = 3000, VoidCallback? onTap, VoidCallback? onSuffixTap, Color? backgroundColor, Color? textColor}) -
const
Properties
- backgroundColor → Color?
-
背景颜色,设置后将覆盖主题默认色
final
- direction → NZNoticeBarDirection
-
滚动方向
final
- duration → int
-
垂直滚动的停留时间 (毫秒)
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- icon → Widget?
-
前置图标
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- onSuffixTap → VoidCallback?
-
后置组件点击回调 (如关闭)
final
- onTap → VoidCallback?
-
点击回调
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- speed → double
-
滚动速度 (像素/秒),仅对水平滚动有效
final
- suffix → Widget?
-
后置组件 (通常是关闭图标或箭头)
final
-
text
→ List<
String> -
公告内容列表,如果是水平滚动通常只传一个 String
final
- textColor → Color?
-
文字颜色,设置后将覆盖主题默认色
final
- theme → NZNoticeBarTheme
-
主题样式
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< NZNoticeBar> -
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