fl_toast
library
Constants
kDefaultToastAnimationDuration
→ const Duration
Default animation duration
When you use Curves.elasticOut, you can specify a longer duration to achieve beautiful effect
But animDuration
* 2 <= toast duration
, conditions must be met for toast to display properly
so when you specify a longer animation duration, you must also specify toast duration to satisfy conditions above
kDefaultToastDuration
→ const Duration
Default toast duration. 4 seconds
Functions
showAndroidToast ({required Widget child , required BuildContext context , Color ? backgroundColor , Duration ? duration , Duration ? animationDuration , VoidCallback ? onDismiss , AlignmentGeometry ? alignment , EdgeInsets ? padding , EdgeInsets ? margin , ToastAnimationBuilder ? animationBuilder } )
→ Future <void >
Shows an AndroidToast
.
showMultiToast ({required List <Toast > toasts , required BuildContext context } )
→ Future <void >
Shows multi toasts at the same time.
showPersistentToast ({required Widget toast , required BuildContext context , bool interactive = true } )
→ OverlayEntry
showPlatformToast ({required Widget child , required BuildContext context , Duration ? duration , Duration ? animationDuration , VoidCallback ? onDismiss , AlignmentGeometry ? alignment , EdgeInsets ? padding , EdgeInsets ? margin , ToastAnimationBuilder ? animationBuilder } )
→ Future <void >
Show a toast according to the platform
showSequencialToasts ({required List <Toast > toasts , required BuildContext context } )
→ Future <void >
Show one toast after another finished
showStyledToast ({required Widget child , required BuildContext context , Color ? backgroundColor , EdgeInsetsGeometry ? contentPadding , EdgeInsetsGeometry ? margin , BorderRadiusGeometry ? borderRadius , Duration ? duration , Duration ? animationDuration , VoidCallback ? onDismiss , AlignmentGeometry ? alignment , ToastAnimationBuilder ? animationBuilder } )
→ Future <void >
Shows a styledToast
showTextToast ({required String text , required BuildContext context , TextStyle ? style , TextOverflow ? overflow , TextAlign textAlign = TextAlign.center , TextDirection ? textDirection , StrutStyle ? strutStyle , double ? textScaleFactor , Duration ? duration , Duration ? animationDuration , VoidCallback ? onDismiss , AlignmentGeometry ? alignment , EdgeInsets ? padding , EdgeInsets ? margin , ToastAnimationBuilder ? animationBuilder , bool usePlatform = false } )
→ Future <void >
Show a text toast. The toast is defined according to the platform.
See showPlatformToast
.
showToast ({required Widget child , required BuildContext context , Duration ? duration , Duration ? animationDuration , VoidCallback ? onDismiss , AlignmentGeometry ? alignment , EdgeInsets ? padding , ToastAnimationBuilder ? animationBuilder } )
→ Future <void >
Show a toast.
showToastWidget ({required Toast toast , required BuildContext context } )
→ Future <void >
Show a toast widget