49 lines
1.2 KiB
Dart
49 lines
1.2 KiB
Dart
import 'package:flutter/material.dart';
|
|
import 'package:penyaluran_app/app/theme/app_colors.dart';
|
|
|
|
class LoadingIndicator extends StatelessWidget {
|
|
final String? message;
|
|
final Color? color;
|
|
final double size;
|
|
|
|
const LoadingIndicator({
|
|
super.key,
|
|
this.message,
|
|
this.color,
|
|
this.size = 40.0,
|
|
});
|
|
|
|
@override
|
|
Widget build(BuildContext context) {
|
|
return Center(
|
|
child: Column(
|
|
mainAxisAlignment: MainAxisAlignment.center,
|
|
crossAxisAlignment: CrossAxisAlignment.center,
|
|
children: [
|
|
SizedBox(
|
|
width: size,
|
|
height: size,
|
|
child: CircularProgressIndicator(
|
|
valueColor: AlwaysStoppedAnimation<Color>(
|
|
color ?? AppColors.primary,
|
|
),
|
|
strokeWidth: 3.0,
|
|
),
|
|
),
|
|
if (message != null) ...[
|
|
const SizedBox(height: 16),
|
|
Text(
|
|
message!,
|
|
style: TextStyle(
|
|
fontSize: 16,
|
|
color: Colors.grey[700],
|
|
),
|
|
textAlign: TextAlign.center,
|
|
),
|
|
],
|
|
],
|
|
),
|
|
);
|
|
}
|
|
}
|