2024-03-25 14:16:00 +08:00
|
|
|
import 'package:flutter/cupertino.dart';
|
2024-03-26 15:30:43 +08:00
|
|
|
import 'package:loading_animation_widget/loading_animation_widget.dart';
|
2024-03-25 14:16:00 +08:00
|
|
|
import 'package:sk_base_mobile/app_theme.dart';
|
|
|
|
import 'package:sk_base_mobile/util/screen_adaper_util.dart';
|
|
|
|
|
|
|
|
class LoadingIndicator extends StatelessWidget {
|
|
|
|
final bool animating;
|
2024-03-26 15:30:43 +08:00
|
|
|
final bool common;
|
2024-04-12 15:17:29 +08:00
|
|
|
final Color? color;
|
2024-03-26 15:30:43 +08:00
|
|
|
const LoadingIndicator(
|
2024-04-12 15:17:29 +08:00
|
|
|
{super.key, this.animating = true, this.common = false, this.color});
|
2024-03-25 14:16:00 +08:00
|
|
|
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
2024-03-26 15:30:43 +08:00
|
|
|
return common
|
|
|
|
? LoadingAnimationWidget.fourRotatingDots(
|
2024-03-28 17:18:46 +08:00
|
|
|
color: AppTheme.primaryColorLight, size: ScreenAdaper.height(45))
|
2024-04-09 08:31:17 +08:00
|
|
|
: Container(
|
|
|
|
padding: EdgeInsets.all(ScreenAdaper.height(10)),
|
|
|
|
child: CupertinoActivityIndicator(
|
|
|
|
animating: animating,
|
2024-04-12 15:17:29 +08:00
|
|
|
color: color ?? AppTheme.primaryColor,
|
2024-04-09 08:31:17 +08:00
|
|
|
radius: ScreenAdaper.sp(25),
|
|
|
|
),
|
2024-03-26 15:30:43 +08:00
|
|
|
);
|
2024-03-25 14:16:00 +08:00
|
|
|
}
|
|
|
|
}
|