addToastNotifications method

void addToastNotifications(
  1. Map<String, ToastStyleFactory> styles
)

Add toast notification styles to the registry. Pass a map of style IDs to widget factory functions.

Example:

nylo.addToastNotifications(ToastNotification.styles);

To add custom styles:

nylo.addToastNotifications({
  ...ToastNotification.styles,
  'custom': ToastNotification.style(
    icon: Icon(Icons.star, color: Colors.purple, size: 20),
    color: Colors.purple.shade50,
    defaultTitle: 'Custom!',
    position: ToastNotificationPosition.bottom,
  ),
});

Implementation

void addToastNotifications(Map<String, ToastStyleFactory> styles) {
  ToastNotificationRegistry.instance.registerAll(styles);
}