NoticeBar class

描述: 通知,默认最小高度36

  1. 支持十种默认样式
  2. 支持设置或者隐藏左右图标
  3. 支持跑马灯
Inheritance

Constructors

NoticeBar({Key? key, Widget? leftWidget, bool showLeftIcon = true, required String content, Color? textColor, Color? backgroundColor, Widget? rightWidget, bool showRightIcon = true, NoticeStyle? noticeStyle, VoidCallback? onNoticeTap, VoidCallback? onRightIconTap, bool marquee = false, EdgeInsets? padding, double minHeight = 36})
const

Properties

backgroundColor Color?
背景颜色
final
content String
通知的内容
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
leftWidget Widget?
自定义左边的图标
final
marquee bool
是否跑马灯 默认值false
final
minHeight double
最小高度。leftWidget、rightWidget 都为空时,限制的最小高度。 可以通过该属性控制组件高度,内容会自动垂直居中。 默认值 36。
final
noticeStyle NoticeStyle?
默认样式,取NoticeStyles里面的值
final
onNoticeTap VoidCallback?
通知钮点击的回调
final
onRightIconTap VoidCallback?
右侧图标点击的回调
final
padding EdgeInsets?
内容的内边距
final
rightWidget Widget?
右边的图标
final
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
showLeftIcon bool
是否显示左边的图标
final
showRightIcon bool
是否显示右边的图标 默认值true
final
textColor Color?
通知的文字颜色
final

Methods

build(BuildContext context) Widget
Describes the part of the user interface represented by this widget.
override
createElement() StatelessElement
Creates a StatelessElement to manage this widget's location in the tree.
inherited
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