NZPopUp class

NZPopUp 是一个微信风格的弹窗组件。 支持标题、内容描述以及横向或纵向排列的操作按钮。

Inheritance

Constructors

NZPopUp({Key? key, String? title, String? content, Widget? contentWidget, required List<NZPopUpAction> actions, Axis actionsAxis = Axis.horizontal, bool barrierDismissible = true})
const

Properties

actions List<NZPopUpAction>
操作按钮列表
final
actionsAxis Axis
按钮排列方向,默认横向。当按钮超过 2 个时建议设为纵向。
final
barrierDismissible bool
是否可以通过点击遮罩层关闭
final
content String?
弹窗内容描述
final
contentWidget Widget?
自定义内容组件,优先级高于 content
final
hashCode int
The hash code for this object.
no setterinherited
key Key?
Controls how one widget replaces another widget in the tree.
finalinherited
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
title String?
弹窗标题
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, 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

Static Methods

alert(BuildContext context, {String? title, String? content, String confirmLabel = '确定', VoidCallback? onConfirm}) Future<void>
快速显示一个仅带“确定”的提示弹窗
confirm(BuildContext context, {String? title, String? content, String confirmLabel = '确定', String cancelLabel = '取消', VoidCallback? onConfirm, VoidCallback? onCancel, bool isDestructive = false}) Future<bool?>
快速显示一个带“确定”和“取消”的确认弹窗
show<T>(BuildContext context, {String? title, String? content, Widget? contentWidget, required List<NZPopUpAction> actions, Axis actionsAxis = Axis.horizontal, bool barrierDismissible = true}) Future<T?>
快速显示一个警告弹窗