### Initialize BotToast with MaterialApp Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Initialize BotToast by wrapping your MaterialApp with BotToastInit and registering BotToastNavigatorObserver. ```dart MaterialApp( title: 'BotToast Demo', builder: BotToastInit(), //1. call BotToastInit navigatorObservers: [BotToastNavigatorObserver()], //2. registered route observer home: XxxxPage(), ) ``` -------------------------------- ### BotToast.showLoading Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a standard loading Toast with options for animation, alignment, and duration. ```APIDOC ## BotToast.showLoading ### Description Displays a standard loading Toast. Supports customization of animations and alignment. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **animationDuration** (Duration) - Optional - Duration for the toast animation. - **animationReverseDuration** (Duration) - Optional - Duration for the reverse toast animation. - **wrapAnimation** (dynamic) - Optional - Animation widget to wrap the toast, defaults to `loadingAnimation`. - **wrapToastAnimation** (dynamic) - Optional - Animation widget specifically for the toast content. - **align** (Alignment) - Optional - Alignment of the ToastContent area, defaults to `Alignment.center`. - **duration** (Duration) - Optional - How long the toast is displayed. - **crossPage** (bool) - Optional - Whether the toast can be displayed across different pages, defaults to true. - **clickClose** (bool) - Optional - Whether the toast can be closed by clicking on it, defaults to false. - **allowClick** (bool) - Optional - Whether clicks are allowed on the toast, defaults to false. - **backgroundColor** (Color) - Optional - Background color of the toast, defaults to `Colors.black26`. - **backButtonBehavior** (dynamic) - Optional - Behavior when the back button is pressed. ``` -------------------------------- ### BotToast.showCustomLoading Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a custom loading Toast, allowing a custom builder for the content and various animation and behavior options. ```APIDOC ## BotToast.showCustomLoading ### Description Displays a custom loading Toast. Requires a `toastBuilder` and allows customization of animations, alignment, and behavior. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **toastBuilder** (dynamic) - Required - A builder function to create the custom loading toast content. - **animationDuration** (Duration) - Optional - Duration for the toast animation. - **animationReverseDuration** (Duration) - Optional - Duration for the reverse toast animation. - **wrapAnimation** (dynamic) - Optional - Animation widget to wrap the toast, defaults to `loadingAnimation`. - **wrapToastAnimation** (dynamic) - Optional - Animation widget specifically for the toast content. - **align** (Alignment) - Optional - Alignment of the ToastContent area, defaults to `Alignment.center`. - **ignoreContentClick** (bool) - Optional - Whether clicks on the toast content are ignored, defaults to false. - **clickClose** (bool) - Optional - Whether the toast can be closed by clicking on it, defaults to false. - **allowClick** (bool) - Optional - Whether clicks are allowed on the toast, defaults to false. - **crossPage** (bool) - Optional - Whether the toast can be displayed across different pages, defaults to false. - **duration** (Duration) - Optional - How long the toast is displayed. - **backgroundColor** (Color) - Optional - Background color of the toast, defaults to `Colors.black26`. - **backButtonBehavior** (dynamic) - Optional - Behavior when the back button is pressed. ``` -------------------------------- ### BotToast.showWidget Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a generic widget on the screen that can persist across multiple pages. ```APIDOC ## BotToast.showWidget ### Description Displays a Widget on the screen. This Widget can exist across multiple pages. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **toastBuilder** (Yes) - None - [toastBuilder details](#General-Parameter-Explanation) - **key** (No) - None - [Key details](#General-Parameter-Explanation) - **groupKey** (No) - None - [groupKey details](#General-Parameter-Explanation) ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Initialize BotToast with Custom Builder Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Initialize BotToast using a custom builder function within MaterialApp, ensuring BotToastInit is called correctly. ```dart //Warning: Don't arbitrarily adjust the position of calling the BotToastInit function final botToastBuilder = BotToastInit(); //1. call BotToastInit MaterialApp( title: 'BotToast Demo', builder: (context, child) { child = myBuilder(context,child); //do something child = botToastBuilder(context,child); return child; }, navigatorObservers: [BotToastNavigatorObserver()], //2. registered route observer home: XxxxPage(), ) ``` -------------------------------- ### Import BotToast Library Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Import the BotToast library into your Dart files to access its functionalities. ```dart import 'package:bot_toast/bot_toast.dart'; ``` -------------------------------- ### BotToast.showText Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a standard text Toast with customizable appearance and behavior. ```APIDOC ## BotToast.showText ### Description Displays a standard text Toast with customizable appearance and behavior. ### Method Not specified (assumed to be a method call in a Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **text** (String) - Required - The text content to display in the toast. - **animationDuration** (Duration) - Optional - The duration of the toast's entrance animation. Defaults to `Duration(milliseconds: 256)`. - **animationReverseDuration** (Duration) - Optional - The duration of the toast's exit animation. - **wrapAnimation** (Animation) - Optional - A custom animation to wrap the toast. - **wrapToastAnimation** (Animation) - Optional - A custom animation specifically for the toast content. Defaults to `textAnimation`. - **align** (Alignment) - Optional - The alignment of the toast content within the main content area. Defaults to `Alignment(0, 0.8)`. - **contentColor** (Color) - Optional - The background color of the toast content area. Defaults to `Colors.black54`. - **borderRadius** (BorderRadius) - Optional - The border radius of the toast content area. Defaults to `BorderRadius.all(Radius.circular(8))`. - **textStyle** (TextStyle) - Optional - The font style for the text. Defaults to `TextStyle(fontSize: 17, color: Colors.white)`. - **contentPadding** (EdgeInsets) - Optional - The padding around the toast content. Defaults to `EdgeInsets.only(left: 14, right: 14, top: 5, bottom: 7)`. - **backgroundColor** (Color) - Optional - The background color of the toast. Defaults to `Colors.transparent`. - **duration** (Duration) - Optional - The duration for which the toast will be displayed. Defaults to `Duration(seconds: 2)`. - **onlyOne** (bool) - Optional - If true, only one text toast can be displayed at a time. Defaults to `true`. - **crossPage** (bool) - Optional - If true, the toast can be displayed across different pages. Defaults to `true`. - **clickClose** (bool) - Optional - If true, the toast can be closed by clicking on it. Defaults to `false`. - **backButtonBehavior** (BackButtonBehavior) - Optional - Defines the behavior when the back button is pressed while the toast is displayed. ``` -------------------------------- ### BotToast.showToast Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a positioned Toast, which can be anchored to a specific Widget or positioned at a given offset relative to the screen. ```APIDOC ## BotToast.showToast ### Description Displays a positioned Toast, which can be anchored to a specific Widget or positioned at a given offset relative to the screen. ### Method Not specified (assumed to be a method call in a Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **attachedBuilder** (Function) - Required - A builder function that provides details for the toast. - **targetContext** (BuildContext) - Optional - The target Widget to which the toast will be attached. Cannot be used with `target`. - **target** (Offset) - Optional - The target offset from the screen's top-left corner. Cannot be used with `targetContext`. - **animationDuration** (Duration) - Optional - The duration of the toast's entrance animation. Defaults to `Duration(milliseconds: 150)`. - **animationReverseDuration** (Duration) - Optional - The duration of the toast's exit animation. - **wrapAnimation** (Animation) - Optional - A custom animation to wrap the toast. - **wrapToastAnimation** (Animation) - Optional - A custom animation specifically for the toast content. - **preferDirection** (Direction) - Optional - The preferred direction for the toast to appear. - **verticalOffset** (double) - Optional - Vertical offset for positioning. Ineffective if the toast is horizontally centered. - **horizontalOffset** (double) - Optional - Horizontal offset for positioning. Ineffective if the toast is vertically centered. - **enableSafeArea** (bool) - Optional - If true, ensures the toast does not overlap the status bar. Defaults to `true`. - **duration** (Duration) - Optional - The duration for which the toast will be displayed. - **onlyOne** (bool) - Optional - If true, only one toast can be displayed at a time. Defaults to `false`. - **allowClick** (bool) - Optional - If true, allows clicks on the toast. Defaults to `true`. - **ignoreContentClick** (bool) - Optional - If true, clicks on the toast content are ignored. Defaults to `false`. - **backgroundColor** (Color) - Optional - The background color of the toast. Defaults to `Colors.transparent`. ``` -------------------------------- ### BotToast.showToastWithAnimation Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a toast with animation. It allows customization of animation durations and wrapping behaviors for the toast content and main area. ```APIDOC ## BotToast.showToastWithAnimation ### Description Displays a toast that uses Animation. This method allows for detailed control over animation durations and wrapping widgets. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **toastBuilder** (Yes) - None - [toastBuilder details](#General-Parameter-Explanation) - **animationDuration** (Yes) - None - Duration of the forward animation, equivalent to [AnimationController.duration]. It is recommended not to exceed [duration]. - **animationReverseDuration** (No) - None - Duration of the reverse animation, equivalent to [AnimationController.reverseDuration]. - **wrapAnimation** (No) - None - Animation wrapping around the `MainContent` area, can be used for custom animations. If null, it means no animation is needed. Using this function does not necessarily mean using animation, it can also be used for additional wrapping of widgets. The biggest difference from `wrapToastAnimation` is the scope of processing. - **wrapToastAnimation** (No) - None - Animation wrapping around the `ToastContent` area, can be used for custom animations. If null, it means no animation is needed. Using this function does not necessarily mean using animation, it can also be used for additional wrapping of widgets. The biggest difference from `wrapAnimation` is the scope of processing. - **key** (No) - None - [Key details](#General-Parameter-Explanation) - **groupKey** (No) - None - [groupKey details](#General-Parameter-Explanation) - **ignoreContentClick** (No) - false - [ignoreContentClick details](#General-Parameter-Explanation) - **clickClose** (No) - false - [clickClose details](#General-Parameter-Explanation) - **onlyOne** (No) - false - [onlyOne details](#General-Parameter-Explanation) - **allowClick** (No) - true - [allowClick details](#General-Parameter-Explanation) - **crossPage** (No) - true - [Refer to showEnhancedWidget.crossPage](#10bottoastshowenhancedwidget) - **closeFunc** (No) - None - [Refer to showEnhancedWidget.closeFunc](#10bottoastshowenhancedwidget) - **warpWidget** (No) - None - [warpWidget details](#10bottoastshowenhancedwidget) - **duration** (No) - None - [Duration details](#General-Parameter-Explanation) - **backgroundColor** (No) - `Colors.transparent` - [backgroundColor details](#General-Parameter-Explanation) - **backButtonBehavior** (No) - None - [backButtonBehavior details](#General-Parameter-Explanation) ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Add BotToast Dependency Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Add the bot_toast dependency to your project's pubspec.yaml file to include the library. ```yaml dependencies: bot_toast: ^4.1.0 #null safety ``` -------------------------------- ### BotToast.showText Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a custom text Toast with various customization options for animations, alignment, duration, and behavior. ```APIDOC ## BotToast.showText ### Description Displays a custom text Toast. Allows customization of animation, duration, and display behavior. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body - **toastBuilder** (dynamic) - Required - A builder function to create the toast content. - **animationDuration** (Duration) - Optional - Duration for the toast animation. - **animationReverseDuration** (Duration) - Optional - Duration for the reverse toast animation. - **wrapAnimation** (dynamic) - Optional - Animation widget to wrap the toast. - **wrapToastAnimation** (dynamic) - Optional - Animation widget specifically for the toast content. - **align** (Alignment) - Optional - Alignment of the ToastContent area. - **duration** (Duration) - Optional - How long the toast is displayed. - **crossPage** (bool) - Optional - Whether the toast can be displayed across different pages. - **onlyOne** (bool) - Optional - Whether only one toast can be displayed at a time. - **clickClose** (bool) - Optional - Whether the toast can be closed by clicking on it. - **ignoreContentClick** (bool) - Optional - Whether clicks on the toast content are ignored. - **backgroundColor** (Color) - Optional - Background color of the toast. - **backButtonBehavior** (dynamic) - Optional - Behavior when the back button is pressed. ``` -------------------------------- ### Upgrade Bot_Toast Initialization from 2.x to 3.x Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Update the initialization method in your MaterialApp widget to reflect changes in Bot_Toast version 3.x. The 2.x version used BotToastInit as a widget, while 3.x uses BotToastInit() as a builder function. ```dart //2.x.x version initialization method BotToastInit( child:MaterialApp( title: 'BotToast Demo', navigatorObservers: [BotToastNavigatorObserver()], home: XxxxPage(), ) ); ``` ```dart //3.x.x version initialization method MaterialApp( title: 'BotToast Demo', builder: BotToastInit(), navigatorObservers: [BotToastNavigatorObserver()], home: XxxxPage(), ) ``` -------------------------------- ### BotToast.showNotification Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a standard notification Toast with various customizable parameters for its appearance and behavior. ```APIDOC ## BotToast.showNotification ### Description Displays a standard notification Toast with customizable header, title, subtitle, footer, dismissal directions, animations, alignment, callbacks, padding, duration, and appearance. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **leading** (dynamic) - Optional - Header content. - **title** (dynamic) - Optional - Title of the notification. - **subTitle** (dynamic) - Optional - Subtitle of the notification. - **trailing** (dynamic) - Optional - Footer content. - **dismissDirections** (List) - Optional - Directions in which sliding dismissal is allowed. Defaults to `[horizontal, up]`. - **animationDuration** (Duration) - Optional - Duration for the entry animation. Defaults to `Duration(milliseconds: 256)`. - **animationReverseDuration** (Duration) - Optional - Duration for the exit animation. - **wrapAnimation** (Widget) - Optional - Widget to wrap the animation. - **wrapToastAnimation** (Widget) - Optional - Widget to wrap the toast animation. Defaults to `notificationAnimation`. - **align** (Alignment) - Optional - Alignment of the ToastContent area. Defaults to `Alignment(0, -0.99)`. - **onTap** (Function) - Optional - Callback when the notification Toast is tapped. - **onLongPress** (Function) - Optional - Callback when the notification Toast is long-pressed. - **contentPadding** (EdgeInsetsGeometry) - Optional - Padding of the ToastContent area. - **duration** (Duration) - Optional - Duration for which the toast is displayed. Defaults to `Duration(seconds: 2)`. - **crossPage** (bool) - Optional - Whether the toast can be displayed across pages. Defaults to `true`. - **onlyOne** (bool) - Optional - Whether only one toast can be shown at a time. Defaults to `true`. - **enableSlideOff** (bool) - Optional - Whether sliding dismissal is enabled. Defaults to `true`. - **backButtonBehavior** (BackButtonBehavior) - Optional - Behavior when the back button is pressed. - **backgroundColor** (Color) - Optional - Background color of the toast. Defaults to `Theme.of(context).cardColor`. - **borderRadius** (BorderRadius) - Optional - Border radius of the toast. Defaults to `ThemeData.cardTheme.shape`. ### Request Example ```dart BotToast.showNotification( title: Text('New Message'), subTitle: Text('Hello there!'), trailing: Icon(Icons.star), ); ``` ### Response #### Success Response None (This method displays a UI element) #### Response Example None ``` -------------------------------- ### BotToast.showCustomNotification Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a custom notification Toast using a provided builder function. ```APIDOC ## BotToast.showCustomNotification ### Description Displays a custom notification Toast, allowing for a fully custom UI defined by the `toastBuilder`. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **toastBuilder** (ToastBuilder) - Required - A function that builds the custom toast UI. - **dismissDirections** (List) - Optional - Directions in which sliding dismissal is allowed. Defaults to `[horizontal, up]`. - **animationDuration** (Duration) - Optional - Duration for the entry animation. Defaults to `Duration(milliseconds: 256)`. - **animationReverseDuration** (Duration) - Optional - Duration for the exit animation. - **wrapAnimation** (Widget) - Optional - Widget to wrap the animation. - **wrapToastAnimation** (Widget) - Optional - Widget to wrap the toast animation. Defaults to `notificationAnimation`. - **align** (Alignment) - Optional - Alignment of the ToastContent area. Defaults to `Alignment(0, -0.99)`. - **enableSlideOff** (bool) - Optional - Whether sliding dismissal is enabled. Defaults to `true`. - **duration** (Duration) - Optional - Duration for which the toast is displayed. Defaults to `Duration(seconds: 2)`. - **crossPage** (bool) - Optional - Whether the toast can be displayed across pages. Defaults to `true`. - **onlyOne** (bool) - Optional - Whether only one toast can be shown at a time. Defaults to `true`. - **backButtonBehavior** (BackButtonBehavior) - Optional - Behavior when the back button is pressed. ### Request Example ```dart BotToast.showCustomNotification( toastBuilder: (cancel) => Card( child: ListTile( title: Text('Custom Toast'), trailing: IconButton(icon: Icon(Icons.close), onPressed: cancel), ), ), ); ``` ### Response #### Success Response None (This method displays a UI element) #### Response Example None ``` -------------------------------- ### BotToast.showSimpleNotification Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a simple notification toast with customizable title, subtitle, and behavior. It returns a function to manually close the toast. ```APIDOC ## BotToast.showSimpleNotification ### Description Displays a simple notification toast with customizable title, subtitle, and behavior. It returns a function to manually close the toast. ### Method POST (Implied, as it's a show method that likely creates a UI element) ### Endpoint Not applicable (SDK method) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body * **title** (string) - Required - The main title of the notification. * **subTitle** (string) - Optional - The subtitle for the notification. * **dismissDirections** (List) - Optional - Directions in which sliding dismissal is allowed. Defaults to `[horizontal, up]`. * **animationDuration** (Duration) - Optional - Duration for the show animation. Defaults to `Duration(milliseconds: 256)`. * **animationReverseDuration** (Duration) - Optional - Reverse duration for the show animation. * **wrapAnimation** (Widget Function) - Optional - A widget function to wrap the toast animation. * **wrapToastAnimation** (Widget Function) - Optional - A widget function to wrap the toast's specific animation. Defaults to `notificationAnimation`. * **align** (Alignment) - Optional - Alignment of the ToastContent area within the MainContent area. Defaults to `Alignment(0, -0.99)`. * **onTap** (Function) - Optional - Callback function when the notification toast is tapped. * **onLongPress** (Function) - Optional - Callback function when the notification toast is long-pressed. * **closeIcon** (Widget) - Optional - Custom icon for the close button. * **enableSlideOff** (bool) - Optional - Whether sliding dismissal is enabled. Defaults to `true`. * **hideCloseButton** (bool) - Optional - Whether to hide the close button. Defaults to `false`. * **duration** (Duration) - Optional - Duration for the toast to be displayed. Defaults to `Duration(seconds: 2)`. * **crossPage** (bool) - Optional - Whether the toast should display across different pages. Defaults to `true`. * **onlyOne** (bool) - Optional - Whether only one toast of this type should exist in the same group. Defaults to `true`. * **backButtonBehavior** (BackButtonBehavior) - Optional - Behavior when the physical back button is pressed. Defaults to `None`. * **backgroundColor** (Color) - Optional - Background color of the toast. Defaults to `Theme.of(context).cardColor`. * **borderRadius** (BorderRadius) - Optional - Border radius of the toast. Defaults to `ThemeData.cardTheme.shape`. ### Request Example ```dart // Example of calling showSimpleNotification final cancelFunc = BotToast.showSimpleNotification( title: "Hello", subTitle: "This is a simple notification.", duration: Duration(seconds: 5), ); // To close the toast manually: // cancelFunc(); ``` ### Response #### Success Response * **CancelFunc** (Function) - A function that can be called to close the displayed toast prematurely. #### Response Example ```dart // The return value is a function, e.g.: () => print('Toast closed'); ``` ``` -------------------------------- ### Show Loading Toast Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Display a loading toast indicator. The returned cancel function can be used to close the toast. ```dart var cancel = BotToast.showLoading(); //popup a loading toast ... cancel(); //close ``` -------------------------------- ### BotToast.showEnhancedWidget Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays an enhanced toast with built-in features like automatic closing based on timers, screen touches, or route changes. ```APIDOC ## BotToast.showEnhancedWidget ### Description Displays an enhanced Toast with built-in features such as automatic timer-based closing, automatic closing on screen touch, and automatic closing when leaving the current Route, and more. ### Method Not specified (assumed to be a function call in a Dart/Flutter context) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None #### Parameters - **toastBuilder** (Yes) - None - [toastBuilder details](#General-Parameter-Explanation) - **key** (No) - None - [Key details](#General-Parameter-Explanation) - **groupKey** (No) - None - [groupKey details](#General-Parameter-Explanation) - **ignoreContentClick** (No) - false - [ignoreContentClick details](#General-Parameter-Explanation) - **clickClose** (No) - false - [clickClose details](#General-Parameter-Explanation) - **onlyOne** (No) - false - [onlyOne details](#General-Parameter-Explanation) - **allowClick** (No) - true - [allowClick details](#General-Parameter-Explanation) - **crossPage** (No) - true - [crossPage details](#General-Parameter-Explanation) - **closeFunc** (No) - None - The main purpose of this function parameter is to perform some actions before closing the Toast. For example, triggering [AnimationController] to start and wait for the animation to finish before closing. - **warpWidget** (No) - None - A wrap function that can be used to wrap the MainContent area. For example, [showCustomLoading] wraps an animation to give the MainContent area animation. - **duration** (No) - None - [Duration details](#General-Parameter-Explanation) - **backgroundColor** (No) - `Colors.transparent` - [backgroundColor details](#General-Parameter-Explanation) - **backButtonBehavior** (No) - None - [backButtonBehavior details](#General-Parameter-Explanation) ### Request Example None ### Response #### Success Response None #### Response Example None ``` -------------------------------- ### Show Simple Notification Source: https://github.com/mmmzq/bot_toast/blob/master/API.md Displays a basic notification toast with customizable title and subtitle. It supports tap and long-press callbacks, and allows for sliding dismissal. ```dart BotToast.showSimpleNotification( title: 'Simple Notification Title', subTitle: 'This is a subtitle for the notification.', duration: Duration(seconds: 3), onTap: () { print('Notification tapped!'); }, ); ``` -------------------------------- ### Modify Global Configuration Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Globally adjust default configurations for various toast types, such as animation duration for standard notifications. ```dart /// For example: Globally change the animation duration for standard notifications to 1 second. BotToast.defaultOption.notification.animationDuration = const Duration(seconds: 1); /// For more default options, refer to the following configurations: /// [BotToast.defaultOption.simpleNotification] corresponds to the default values of [showSimpleNotification]. /// [BotToast.defaultOption.notification] corresponds to the default values of [showNotification]. /// [BotToast.defaultOption.customNotification] corresponds to the default values of [showCustomNotification]. /// [BotToast.defaultOption.text] corresponds to the default values of [showText]. /// [BotToast.defaultOption.customText] corresponds to the default values of [showCustomText]. /// [BotToast.defaultOption.loading] corresponds to the default values of [showLoading]. /// [BotToast.defaultOption.customLoading] corresponds to the default values of [showCustomLoading]. /// [BotToast.defaultOption.attached] corresponds to the default values of [showAttachedWidget]. /// [BotToast.defaultOption.animation] corresponds to the default values of [showAnimationWidget]. /// [BotToast.defaultOption.enhanced] corresponds to the default values of [showEnhancedWidget]. ``` -------------------------------- ### Show Custom Toast APIs Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Utilize custom API methods for displaying various types of toasts, including custom notifications, text, loading, and animation widgets. Each returns a cancel function. ```dart //custom api var cancel = BotToast.showCustomNotification(...) var cancel = BotToast.showCustomText(...) var cancel = BotToast.showCustomLoading(...) var cancel = BotToast.showAnimationWidget(...) ... cancel(); //close ``` -------------------------------- ### Show Attached Widget Toast Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Display a toast using an attached widget, specifying the widget builder, duration, and target offset. The returned cancel function closes the toast. ```dart //popup a attachments toast var cancel = BotToast.showAttachedWidget( attachedBuilder: (_) => Card( child: Padding( padding: const EdgeInsets.all(8.0), child: Icon( Icons.favorite, color: Colors.redAccent, ), ), ), duration: Duration(seconds: 2), target: Offset(520, 520)); ... cancel(); //close ``` -------------------------------- ### Show Simple Notification Toast Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Display a simple notification toast with a title. The returned cancel function can be used to close the toast. ```dart var cancel = BotToast.showSimpleNotification(title: "init"); // popup a notification toast; ... cancel(); //close ``` -------------------------------- ### Show Text Toast Source: https://github.com/mmmzq/bot_toast/blob/master/README.md Display a simple text toast message. The returned cancel function can be used to close the toast. ```dart var cancel = BotToast.showText(text:"xxxx"); //popup a text toast; ... cancel(); //close ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.