feat: use cupertino loading again
This commit is contained in:
parent
a3619ba340
commit
8258232d48
|
@ -1,20 +1,32 @@
|
|||
import 'package:flutter/material.dart';
|
||||
import 'package:flutter/cupertino.dart';
|
||||
import 'package:git_touch/models/theme.dart';
|
||||
import 'package:provider/provider.dart';
|
||||
|
||||
class Loading extends StatelessWidget {
|
||||
final bool more;
|
||||
|
||||
Loading({this.more = false});
|
||||
|
||||
Widget _buildIndicator(BuildContext context) {
|
||||
switch (Provider.of<ThemeModel>(context).theme) {
|
||||
case AppThemeType.cupertino:
|
||||
return CupertinoActivityIndicator(radius: 12);
|
||||
default:
|
||||
return SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return Center(
|
||||
child: Padding(
|
||||
padding: EdgeInsets.symmetric(vertical: more ? 20 : 100),
|
||||
child: SizedBox(
|
||||
width: 24,
|
||||
height: 24,
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
child: _buildIndicator(context),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue