loading static method
String
loading(
- String message, {
- String? title,
- ToastrPosition? position,
- ToastrShowMethod? showMethod,
- ToastrHideMethod? hideMethod,
- Duration? showDuration,
- Duration? hideDuration,
- bool? showCloseButton,
- VoidCallback? onTap,
- VoidCallback? onDismiss,
- Widget? content,
- double? maxWidth,
- EdgeInsets? margin,
- Color? accentColor,
- BoxDecoration? containerDecoration,
- ToastrTheme? theme,
- ToastrAction? action,
- bool? enableHapticFeedback,
- HapticFeedbackType? hapticFeedbackType,
- SwipeDismissDirection? swipeDismissDirection,
- Widget enterAnimationBuilder()?,
- Widget exitAnimationBuilder()?,
- bool? compact,
- BorderRadius? borderRadius,
- bool? avoidKeyboard,
- double? stackOverlap,
- bool? showCircularProgress,
- double? gutter,
- ToastrIconTheme? iconTheme,
Show a loading toastr with an animated spinner.
Loading toasts persist until manually dismissed or updated.
Returns the toast ID — use it with dismiss or update.
final id = Toastr.loading('Uploading...');
await uploadFile();
Toastr.dismiss(id);
Implementation
static String loading(
String message, {
String? title,
ToastrPosition? position,
ToastrShowMethod? showMethod,
ToastrHideMethod? hideMethod,
Duration? showDuration,
Duration? hideDuration,
bool? showCloseButton,
VoidCallback? onTap,
VoidCallback? onDismiss,
Widget? content,
double? maxWidth,
EdgeInsets? margin,
Color? accentColor,
BoxDecoration? containerDecoration,
ToastrTheme? theme,
ToastrAction? action,
bool? enableHapticFeedback,
HapticFeedbackType? hapticFeedbackType,
SwipeDismissDirection? swipeDismissDirection,
Widget Function(Widget child, Animation<double> animation)? enterAnimationBuilder,
Widget Function(Widget child, Animation<double> animation)? exitAnimationBuilder,
bool? compact,
BorderRadius? borderRadius,
bool? avoidKeyboard,
double? stackOverlap,
bool? showCircularProgress,
double? gutter,
ToastrIconTheme? iconTheme,
}) =>
_showWithOptions(
ToastrType.loading,
message,
title: title,
duration: const Duration(days: 365),
position: position,
showMethod: showMethod,
hideMethod: hideMethod,
showDuration: showDuration,
hideDuration: hideDuration,
showProgressBar: false,
showCloseButton: showCloseButton ?? false,
preventDuplicates: false,
onTap: onTap,
onDismiss: onDismiss,
content: content,
maxWidth: maxWidth,
margin: margin,
accentColor: accentColor,
containerDecoration: containerDecoration,
theme: theme,
action: action,
enableHapticFeedback: enableHapticFeedback,
hapticFeedbackType: hapticFeedbackType,
swipeDismissDirection: swipeDismissDirection,
enterAnimationBuilder: enterAnimationBuilder,
exitAnimationBuilder: exitAnimationBuilder,
compact: compact,
borderRadius: borderRadius,
avoidKeyboard: avoidKeyboard,
stackOverlap: stackOverlap,
showCircularProgress: showCircularProgress,
gutter: gutter,
iconTheme: iconTheme,
);