Skip to content

Commit a8ae4f9

Browse files
committed
update README.md
1 parent aa176a4 commit a8ae4f9

2 files changed

Lines changed: 20 additions & 18 deletions

File tree

README-zh_CN.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
2929
class MyApp extends StatelessWidget {
3030
@override
3131
Widget build(BuildContext context) {
32-
/// 子组件通常为 [MaterialApp] 或者 [CupertinoApp].
33-
/// 这样做是为了确保 loading 组件能覆盖在其他组件之上.
34-
return FlutterEasyLoading(
35-
child: MaterialApp(
36-
title: 'Flutter EasyLoading',
37-
theme: ThemeData(
38-
primarySwatch: Colors.blue,
39-
),
40-
home: MyHomePage(title: 'Flutter EasyLoading'),
32+
return MaterialApp(
33+
title: 'Flutter EasyLoading',
34+
theme: ThemeData(
35+
primarySwatch: Colors.blue,
4136
),
37+
builder: (BuildContext context, Widget child) {
38+
/// 确保 loading 组件能覆盖在其他组件之上.
39+
return FlutterEasyLoading(
40+
child: MyHomePage(title: 'Flutter EasyLoading'),
41+
);
42+
},
4243
);
4344
}
4445
}

README.md

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -29,16 +29,17 @@ first, warp your app widget with `FlutterEasyLoading`:
2929
class MyApp extends StatelessWidget {
3030
@override
3131
Widget build(BuildContext context) {
32-
/// child should be [MaterialApp] or [CupertinoApp].
33-
/// make sure that loading can be displayed in front of all other widgets
34-
return FlutterEasyLoading(
35-
child: MaterialApp(
36-
title: 'Flutter EasyLoading',
37-
theme: ThemeData(
38-
primarySwatch: Colors.blue,
39-
),
40-
home: MyHomePage(title: 'Flutter EasyLoading'),
32+
return MaterialApp(
33+
title: 'Flutter EasyLoading',
34+
theme: ThemeData(
35+
primarySwatch: Colors.blue,
4136
),
37+
builder: (BuildContext context, Widget child) {
38+
/// make sure that loading can be displayed in front of all other widgets
39+
return FlutterEasyLoading(
40+
child: MyHomePage(title: 'Flutter EasyLoading'),
41+
);
42+
},
4243
);
4344
}
4445
}

0 commit comments

Comments
 (0)