1- # flutter_easyloading
1+ # Flutter EasyLoading
22
33[ ![ pub package] ( https://img.shields.io/pub/v/flutter_easyloading?style=flat )] ( https://pub.dev/packages/flutter_easyloading ) [ ![ pub points] ( https://badges.bar/flutter_easyloading/pub%20points )] ( https://pub.dev/packages/flutter_easyloading/score ) [ ![ popularity] ( https://badges.bar/flutter_easyloading/popularity )] ( https://pub.dev/packages/flutter_easyloading/score ) [ ![ likes] ( https://badges.bar/flutter_easyloading/likes )] ( https://pub.dev/packages/flutter_easyloading/score ) [ ![ license] ( https://img.shields.io/github/license/huangjianke/flutter_easyloading?style=flat )] ( https://github.com/huangjianke/flutter_easyloading ) [ ![ stars] ( https://img.shields.io/github/stars/huangjianke/flutter_easyloading?style=social )] ( https://github.com/huangjianke/flutter_easyloading )
44
@@ -16,7 +16,7 @@ Add this to your package's `pubspec.yaml` file:
1616
1717``` yaml
1818dependencies :
19- flutter_easyloading : ^2.0.1
19+ flutter_easyloading : ^2.1.0
2020` ` `
2121
2222## Import
@@ -67,8 +67,30 @@ EasyLoading.showToast('Toast');
6767EasyLoading.dismiss();
6868```
6969
70+ Add loading status callback
71+
72+ ``` dart
73+ EasyLoading.addStatusCallback((status) {
74+ print('EasyLoading Status $status');
75+ });
76+ ```
77+
78+ Remove loading status callback(s)
79+
80+ ``` dart
81+ EasyLoading.removeCallback(statusCallback);
82+
83+ EasyLoading.removeAllCallbacks();
84+ ```
85+
7086## Customize
7187
88+ ❗️** Note:**
89+
90+ - ** ` textColor ` 、` indicatorColor ` 、` progressColor ` 、` backgroundColor ` only used for ` EasyLoadingStyle.custom ` .**
91+
92+ - ** ` maskColor ` only used for ` EasyLoadingMaskType.custom ` .**
93+
7294``` dart
7395/// loading style, default [EasyLoadingStyle.dark].
7496EasyLoadingStyle loadingStyle;
@@ -139,6 +161,9 @@ Color maskColor;
139161/// should allow user interactions while loading is displayed.
140162bool userInteractions;
141163
164+ /// should dismiss on user tap.
165+ bool dismissOnTap;
166+
142167/// indicator widget of loading
143168Widget indicatorWidget;
144169
@@ -152,13 +177,6 @@ Widget errorWidget;
152177Widget infoWidget;
153178```
154179
155- ❗️** Note:**
156-
157- - ** ` textColor ` 、` indicatorColor ` 、` progressColor ` 、` backgroundColor ` only used for ` EasyLoadingStyle.custom ` .**
158-
159- - ** ` maskColor ` only used for ` EasyLoadingMaskType.custom ` .**
160-
161-
162180Because of ` EasyLoading ` is a singleton, so you can custom loading style any where like this:
163181
164182``` dart
@@ -168,11 +186,14 @@ EasyLoading.instance
168186 ..loadingStyle = EasyLoadingStyle.dark
169187 ..indicatorSize = 45.0
170188 ..radius = 10.0
189+ ..progressColor = Colors.yellow
171190 ..backgroundColor = Colors.green
172191 ..indicatorColor = Colors.yellow
173192 ..textColor = Colors.yellow
174193 ..maskColor = Colors.blue.withOpacity(0.5)
175- ..userInteractions = true;
194+ ..userInteractions = true
195+ ..dismissOnTap = false
196+ ..customAnimation = CustomAnimation();
176197```
177198
178199More indicatorType can see in 👉 [ flutter_spinkit showcase] ( https://github.com/jogboms/flutter_spinkit#-showcase )
0 commit comments