mobile_skt/lib/widgets/loading_indicator.dart

28 lines
938 B
Dart
Raw Normal View History

2024-10-16 09:48:17 +08:00
import 'package:flutter/cupertino.dart';
import 'package:loading_animation_widget/loading_animation_widget.dart';
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;
final bool common;
final Color? color;
const LoadingIndicator(
{super.key, this.animating = true, this.common = false, this.color});
@override
Widget build(BuildContext context) {
return common
? LoadingAnimationWidget.fourRotatingDots(
color: AppTheme.primaryColorLight, size: ScreenAdaper.height(45))
: Container(
padding: EdgeInsets.all(ScreenAdaper.height(10)),
child: CupertinoActivityIndicator(
animating: animating,
color: color ?? AppTheme.primaryColor,
radius: ScreenAdaper.sp(25),
),
);
}
}