WeNotification class abstract final

A titled card in a screen corner that stacks with its neighbours, after ElNotification. Use it for events the user did not just trigger, such as a finished export or a failed sync; WeMessage is for direct feedback.

WeNotification.success(context, title: '导出完成', message: '文件已保存到下载目录');
WeNotification.show(
  context,
  title: '库存告急',
  message: '仅剩 46 件',
  type: SemanticEnum.warning,
  position: WeNotificationPosition.bottomRight,
  onClick: () => openStock(),
);

A Duration.zero keeps the card until it is closed by the user, through the returned WeNotificationHandle or closeAll.

Properties

hashCode → int
The hash code for this object.
no setterinherited
runtimeType → Type
A representation of the runtime type of the object.
no setterinherited

Methods

noSuchMethod(Invocation invocation) → dynamic
Invoked when a nonexistent method or property is accessed.
inherited
toString() → String
A string representation of this object.
inherited

Operators

operator ==(Object other) → bool
The equality operator.
inherited

Static Methods

closeAll() → void
Dismisses every visible notification, in every corner.
error(BuildContext context, {String? title, String? message, WeNotificationPosition position = WeNotificationPosition.topRight, Duration duration = const Duration(milliseconds: 4500), VoidCallback? onClick}) → WeNotificationHandle
info(BuildContext context, {String? title, String? message, WeNotificationPosition position = WeNotificationPosition.topRight, Duration duration = const Duration(milliseconds: 4500), VoidCallback? onClick}) → WeNotificationHandle
show(BuildContext context, {String? title, String? message, Widget? content, SemanticEnum? type, WeNotificationPosition position = WeNotificationPosition.topRight, Duration duration = const Duration(milliseconds: 4500), bool closable = true, bool showIcon = true, IconData? icon, double width = 330, double offset = 16, VoidCallback? onClick}) → WeNotificationHandle
success(BuildContext context, {String? title, String? message, WeNotificationPosition position = WeNotificationPosition.topRight, Duration duration = const Duration(milliseconds: 4500), VoidCallback? onClick}) → WeNotificationHandle
warning(BuildContext context, {String? title, String? message, WeNotificationPosition position = WeNotificationPosition.topRight, Duration duration = const Duration(milliseconds: 4500), VoidCallback? onClick}) → WeNotificationHandle