NotificationMessage class

一个消息吐丝单元,用于显示具体的Toast消息

Inheritance
Annotations
  • @Deprecated('NotifyToasts 的内部卡片,随 NotifyToasts 一起在 1.0.0 移除')

Constructors

NotificationMessage({Key? key, required BuildContext context, required OverlayEntry entry, required String title, required String message, required Duration duration, required Duration animationDuration, required NotifyToastPosition position, required AnimatedWidget animationEffect(Animation<double>, Widget), required bool showClose, required bool autoClose, required VoidCallback onDismissed, required OverlayEntry overlayEntry, SemanticEnum? type, Color? color, TextStyle? messageStyle, double? width, VoidCallback? onTap, Widget? icon, BorderRadiusGeometry? borderRadius, TextStyle? titleStyle})
const

Properties

animationDuration → Duration
动画时间
final
animationEffect → AnimatedWidget Function(Animation<double>, Widget)
自定义动画效果,用于消息的显示和隐藏。
final
autoClose → bool
是否自动关闭消息。
final
borderRadius → BorderRadiusGeometry?
消息框的边框圆角。
final
color → Color?
消息框的背景颜色。
final
context → BuildContext
上下文,用于定位Overlay。
final
duration → Duration
消息显示持续时间。
final
entry → OverlayEntry
OverlayEntry对象,用于控制Toast的显示和隐藏。
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
message → String
主要显示的消息内容。
final
messageStyle → TextStyle?
消息文本的样式。
final
onDismissed → VoidCallback
当消息被关闭时的回调函数。
final
onTap → VoidCallback?
点击消息时的回调函数。
final
overlayEntry → OverlayEntry
同entry,用于内部处理。
final
position → NotifyToastPosition
消息显示的位置,如左上、右上等。
final
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited
showClose → bool
是否显示关闭按钮。
final
title → String
消息标题,如果没有特定标题则可以为空。
final
titleStyle → TextStyle?
标题文本的样式。
final
type → SemanticEnum?
消息类型,用于定义消息的语义和颜色。
final
width → double?
消息框的宽度。
final

Methods

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