alerts/ny_alerts library

Classes

DefaultToastNotification
DefaultToastNotification a simple toast notification. This is the fallback widget used when no custom toast styles are registered.
ToastAnimation
ToastAnimation defines animation styles for toast notifications. Use factory constructors to create different animation effects.
ToastMeta
Toast Meta makes it easy to use pre-defined styles in the toast alert.
ToastNotificationRegistry
Registry for toast notification styles. Stores widget factories keyed by string IDs (e.g., "success", "warning"). Use ToastNotificationRegistry.register to add custom toast styles.

Enums

ToastAnimationType
Animation type for toast notifications.
ToastNotificationPosition
Position where the toast notification appears.

Functions

showToastNotification(BuildContext context, {String id = 'success', String? title, String? description, Duration? duration, ToastNotificationPosition? position, ToastAnimation? animation, VoidCallback? action, VoidCallback? onDismiss, VoidCallback? onShow}) → void
Display a new Toast notification to the user. Provide a valid toast id (e.g., "success", "warning", "info", "danger") or a custom ID registered via Nylo.addToastNotifications. Set a title and description to personalize the message.

Typedefs

ToastOnInitStateCallback = dynamic Function(Duration toastDuration, Duration animDuration)
Callback for the toast widget's initState lifecycle hook. Receives the toast display duration and animation animDuration.
ToastStyleFactory = Widget Function(ToastMeta meta, void updateMeta(ToastMeta))
Typedef for toast style factory function. The factory receives the ToastMeta and an updateMeta callback to allow the widget to update position, duration, etc.