File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -29,16 +29,17 @@ import 'package:flutter_easyloading/flutter_easyloading.dart';
2929class 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}
Original file line number Diff line number Diff line change @@ -29,16 +29,17 @@ first, warp your app widget with `FlutterEasyLoading`:
2929class 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}
You can’t perform that action at this time.
0 commit comments