2019-01-31 08:23:52 +01:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:flutter/cupertino.dart';
|
2020-10-03 08:37:06 +02:00
|
|
|
import 'package:git_touch/models/theme.dart';
|
|
|
|
import 'package:provider/provider.dart';
|
2019-01-31 08:23:52 +01:00
|
|
|
|
|
|
|
class Loading extends StatelessWidget {
|
|
|
|
final bool more;
|
|
|
|
|
2019-02-10 06:17:25 +01:00
|
|
|
Loading({this.more = false});
|
2020-10-03 08:37:06 +02:00
|
|
|
|
|
|
|
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(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2019-01-31 08:23:52 +01:00
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2019-09-29 16:10:15 +02:00
|
|
|
return Center(
|
|
|
|
child: Padding(
|
|
|
|
padding: EdgeInsets.symmetric(vertical: more ? 20 : 100),
|
2020-10-03 08:37:06 +02:00
|
|
|
child: _buildIndicator(context),
|
2019-09-29 16:10:15 +02:00
|
|
|
),
|
|
|
|
);
|
2019-01-31 08:23:52 +01:00
|
|
|
}
|
|
|
|
}
|