mini_loading.dart
2.78 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
import '../core_flutter.dart';
class MiniLoading extends StatelessWidget{
MiniLoading({this.context, this.content = 'content'});
final BuildContext context;
final String content;
@override
Widget build(BuildContext _) {
ThemeData themeData = Theme.of(context);
return WillPopScope(
child: Material(
color: Colors.transparent,
child: Theme(data: themeData.copyWith(accentColor: themeData.primaryColor), child: Center(
child: Container(
width: double.infinity,
height: double.infinity,
color: Color.fromRGBO(0, 0, 0, 0.3),
child: Center(
child: Container(
width: ToPx.size(250),
height: ToPx.size(250),
padding: EdgeInsets.symmetric(
horizontal: ToPx.size(20), vertical: ToPx.size(30)),
decoration: BoxDecoration(
color: Color.fromRGBO(0, 0, 0, .7),
borderRadius:
BorderRadius.all(Radius.circular(5.0))),
child: Column(
children: <Widget>[
Padding(
padding: EdgeInsets.only(
bottom: ToPx.size(40), top: ToPx.size(20)),
child: Platform.isIOS == true
? CupertinoActivityIndicator(
radius: ToPx.size(30),
)
: SizedBox(
width: ToPx.size(45),
height: ToPx.size(45),
child: CircularProgressIndicator(
backgroundColor: Colors.white,
strokeWidth: 2.0,
),
)),
Expanded(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
children: <Widget>[
Text(
content,
style: TextStyle(
color: Color(0xffffffff),
fontSize: ToPx.size(32)),
textAlign: TextAlign.center,
),
],
),
)
],
)),
),
)
)),
),
onWillPop: () async {
return false;
});
}
}