Skip to content

Commit 60559f3

Browse files
committed
update README.md
1 parent 419326c commit 60559f3

2 files changed

Lines changed: 22 additions & 6 deletions

File tree

README-zh_CN.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212

1313
```yaml
1414
dependencies:
15-
flutter_easyloading: ^1.1.2
15+
flutter_easyloading: ^1.1.3
1616
```
1717
1818
## 导入
@@ -128,9 +128,17 @@ Widget infoWidget;
128128

129129
❗️**注意:**
130130

131-
*`textColor``indicatorColor``progressColor``backgroundColor` 仅对 `EasyLoadingStyle.custom`有效。*
131+
- **`textColor``indicatorColor``progressColor``backgroundColor` 仅对 `EasyLoadingStyle.custom`有效。**
132132

133-
*`maskColor` 仅对 `EasyLoadingMaskType.custom`有效。*
133+
- **`maskColor` 仅对 `EasyLoadingMaskType.custom`有效。**
134+
135+
- **如果你想在 `initState` 方法里面使用 `EasyLoading`, 你应该这样做:**
136+
```dart
137+
/// 帧绘制完成回调通知
138+
WidgetsBinding.instance.addPostFrameCallback((_) {
139+
EasyLoading.showSuccess('Great Success!');
140+
});
141+
```
134142

135143
因为 `EasyLoading` 是一个全局单例, 所以你可以在任意一个地方自定义它的样式:
136144

README.md

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ Add this to your package's `pubspec.yaml` file:
1212

1313
```yaml
1414
dependencies:
15-
flutter_easyloading: ^1.1.2
15+
flutter_easyloading: ^1.1.3
1616
```
1717
1818
## Import
@@ -128,9 +128,17 @@ Widget infoWidget;
128128

129129
❗️**Note:**
130130

131-
*`textColor``indicatorColor``progressColor``backgroundColor` only used for `EasyLoadingStyle.custom`.*
131+
- **`textColor``indicatorColor``progressColor``backgroundColor` only used for `EasyLoadingStyle.custom`.**
132132

133-
*`maskColor` only used for `EasyLoadingMaskType.custom`.*
133+
- **`maskColor` only used for `EasyLoadingMaskType.custom`.**
134+
135+
- **if you want use `EasyLoading` in `initState` method, you should do like this:**
136+
```dart
137+
/// Schedule a callback for the end of this frame
138+
WidgetsBinding.instance.addPostFrameCallback((_) {
139+
EasyLoading.showSuccess('Great Success!');
140+
});
141+
```
134142

135143
because `EasyLoading` is a singleton, so you can custom loading style any where like this:
136144

0 commit comments

Comments
 (0)