1
0
mirror of https://github.com/git-touch/git-touch synced 2024-12-22 13:25:13 +01:00
git-touch-android-ios-app/lib/widgets/loading.dart

40 lines
934 B
Dart
Raw Normal View History

2019-01-31 08:23:52 +01:00
import 'package:flutter/material.dart';
import 'package:flutter/cupertino.dart';
import '../providers/settings.dart';
class Loading extends StatelessWidget {
final bool more;
Loading({this.more = false});
2019-01-31 08:23:52 +01:00
Widget _buildIndicator(BuildContext context) {
2019-02-07 07:35:19 +01:00
switch (SettingsProvider.of(context).theme) {
case ThemeMap.cupertino:
2019-01-31 08:23:52 +01:00
return CupertinoActivityIndicator(radius: 12);
default:
return Center(
child: SizedBox(
width: 24,
height: 24,
child: CircularProgressIndicator(),
),
);
}
}
@override
Widget build(BuildContext context) {
if (more) {
return Padding(
padding: EdgeInsets.symmetric(vertical: 20),
child: _buildIndicator(context),
);
} else {
return Padding(
2019-02-10 12:15:50 +01:00
padding: EdgeInsets.symmetric(vertical: 50),
2019-01-31 08:23:52 +01:00
child: _buildIndicator(context),
);
}
}
}