@@ -28,6 +28,8 @@ A really easy to use flutter toast library!
28
28
29
29
- Pure flutter implementation
30
30
31
+ - Supports global configuration
32
+
31
33
32
34
### 🐼Online Demo
33
35
@@ -48,19 +50,19 @@ Loading|Text|CustomWidget
48
50
49
51
### 🐮Getting started
50
52
51
- #### 1. add dependencies into you project pubspec.yaml file
53
+ #### 1. Add dependencies into you project pubspec.yaml file
52
54
``` yaml
53
55
dependencies :
54
56
bot_toast : ^3.0.5
55
57
# bot_toast: ^4.0.0 #null safety
56
58
```
57
59
58
- #### 2. import BotToast lib
60
+ #### 2. Import BotToast Lib
59
61
``` dart
60
62
import 'package:bot_toast/bot_toast.dart';
61
63
```
62
64
63
- #### 3. initialization BotToast
65
+ #### 3. Initialization BotToast
64
66
``` dart
65
67
MaterialApp(
66
68
title: 'BotToast Demo',
@@ -85,7 +87,7 @@ MaterialApp(
85
87
)
86
88
```
87
89
88
- #### 4. use BotToast
90
+ #### 4. Use BotToast
89
91
``` dart
90
92
var cancel = BotToast.showText(text:"xxxx"); //popup a text toast;
91
93
...
@@ -132,6 +134,25 @@ var cancel = BotToast.showAnimationWidget(...)
132
134
cancel(); //close
133
135
```
134
136
137
+ #### 5. Modify Global Configuration
138
+
139
+ ``` dart
140
+ /// For example: Globally change the animation duration for standard notifications to 1 second.
141
+ BotToast.defaultOption.notification.animationDuration = const Duration(seconds: 1);
142
+
143
+ /// For more default options, refer to the following configurations:
144
+ /// [BotToast.defaultOption.simpleNotification] corresponds to the default values of [showSimpleNotification].
145
+ /// [BotToast.defaultOption.notification] corresponds to the default values of [showNotification].
146
+ /// [BotToast.defaultOption.customNotification] corresponds to the default values of [showCustomNotification].
147
+ /// [BotToast.defaultOption.text] corresponds to the default values of [showText].
148
+ /// [BotToast.defaultOption.customText] corresponds to the default values of [showCustomText].
149
+ /// [BotToast.defaultOption.loading] corresponds to the default values of [showLoading].
150
+ /// [BotToast.defaultOption.customLoading] corresponds to the default values of [showCustomLoading].
151
+ /// [BotToast.defaultOption.attached] corresponds to the default values of [showAttachedWidget].
152
+ /// [BotToast.defaultOption.animation] corresponds to the default values of [showAnimationWidget].
153
+ /// [BotToast.defaultOption.enhanced] corresponds to the default values of [showEnhancedWidget].
154
+ ```
155
+
135
156
### 🐼3.0 version
136
157
137
158
#### Major changes:
0 commit comments