ToastMeta class

Toast Meta makes it easy to use pre-defined styles in the toast alert.

Constructors

ToastMeta({Widget? icon, required String title, required String style, required String description, Color? color, Function? action, Function? dismiss, Duration duration = const Duration(seconds: 2), Map<String, dynamic>? metaData})
ToastMeta.custom({Color? backgroundColor, String? description, String? title, Duration? duration, Function? action, Map<String, dynamic>? metaData, Widget? icon = const Icon(Icons.warning, color: Colors.redAccent, size: 20)})
Pre-defined style for the ToastNotificationStyleType.CUSTOM toast alert.
ToastMeta.danger({Color? backgroundColor, String? description, String? title, Duration? duration, Function? action, Map<String, dynamic>? metaData, Widget? icon = const Icon(Icons.warning, color: Colors.redAccent, size: 20)})
Pre-defined style for the ToastNotificationStyleType.DANGER toast alert.
ToastMeta.info({Color? backgroundColor, String? description, String? title, Duration? duration, Function? action, Map<String, dynamic>? metaData, Widget? icon = const Icon(Icons.info, color: Colors.teal, size: 20)})
Pre-defined style for the ToastNotificationStyleType.INFO toast alert.
ToastMeta.success({Color? backgroundColor, String? description, String? title, Duration? duration, Function? action, Map<String, dynamic>? metaData, Widget? icon = const Icon(Icons.check, color: Colors.green, size: 20)})
Pre-defined style for the ToastNotificationStyleType.SUCCESS toast alert.
ToastMeta.warning({Color? backgroundColor, String? description, String? title, Duration? duration, Function? action, Map<String, dynamic>? metaData, Widget? icon = const Icon(Icons.error_outline, color: Colors.orange, size: 20)})
Pre-defined style for the ToastNotificationStyleType.WARNING toast alert.

Properties

action Function?
getter/setter pair
color Color?
getter/setter pair
description String
getter/setter pair
dismiss Function?
getter/setter pair
duration Duration
getter/setter pair
hashCode int
The hash code for this object.
no setterinherited
icon Widget?
getter/setter pair
metaData Map<String, dynamic>?
getter/setter pair
runtimeType Type
A representation of the runtime type of the object.
no setterinherited
style String
getter/setter pair
title String
getter/setter pair

Methods

copyWith({Widget? icon, String? title, String? style, String? description, Color? color, Function? action, Function? dismiss, Duration? duration}) ToastMeta
ToastMeta.copyWith() is used to copy the current toast alert and override the values.
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