Skip to content

Commit 8258232

Browse files
committed
feat: use cupertino loading again
1 parent a3619ba commit 8258232

File tree

1 file changed

+17
-5
lines changed

1 file changed

+17
-5
lines changed

lib/widgets/loading.dart

+17-5
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,32 @@
11
import 'package:flutter/material.dart';
22
import 'package:flutter/cupertino.dart';
3+
import 'package:git_touch/models/theme.dart';
4+
import 'package:provider/provider.dart';
35

46
class Loading extends StatelessWidget {
57
final bool more;
68

79
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+
824
@override
925
Widget build(BuildContext context) {
1026
return Center(
1127
child: Padding(
1228
padding: EdgeInsets.symmetric(vertical: more ? 20 : 100),
13-
child: SizedBox(
14-
width: 24,
15-
height: 24,
16-
child: CircularProgressIndicator(),
17-
),
29+
child: _buildIndicator(context),
1830
),
1931
);
2032
}

0 commit comments

Comments
 (0)