File tree 1 file changed +17
-5
lines changed
1 file changed +17
-5
lines changed Original file line number Diff line number Diff line change 1
1
import 'package:flutter/material.dart' ;
2
2
import 'package:flutter/cupertino.dart' ;
3
+ import 'package:git_touch/models/theme.dart' ;
4
+ import 'package:provider/provider.dart' ;
3
5
4
6
class Loading extends StatelessWidget {
5
7
final bool more;
6
8
7
9
Loading ({this .more = false });
10
+
11
+ Widget _buildIndicator (BuildContext context) {
12
+ switch (Provider .of <ThemeModel >(context).theme) {
13
+ case AppThemeType .cupertino:
14
+ return CupertinoActivityIndicator (radius: 12 );
15
+ default :
16
+ return SizedBox (
17
+ width: 24 ,
18
+ height: 24 ,
19
+ child: CircularProgressIndicator (),
20
+ );
21
+ }
22
+ }
23
+
8
24
@override
9
25
Widget build (BuildContext context) {
10
26
return Center (
11
27
child: Padding (
12
28
padding: EdgeInsets .symmetric (vertical: more ? 20 : 100 ),
13
- child: SizedBox (
14
- width: 24 ,
15
- height: 24 ,
16
- child: CircularProgressIndicator (),
17
- ),
29
+ child: _buildIndicator (context),
18
30
),
19
31
);
20
32
}
You can’t perform that action at this time.
0 commit comments