This commit is contained in:
2025-09-26 18:48:14 +07:00
parent 382a0e7909
commit 30ed6b39b5
85 changed files with 20722 additions and 112 deletions

View File

@@ -0,0 +1,69 @@
import 'package:flutter/material.dart';
/// A customizable loading widget
class LoadingWidget extends StatelessWidget {
final String? message;
final double size;
final Color? color;
const LoadingWidget({
super.key,
this.message,
this.size = 24.0,
this.color,
});
@override
Widget build(BuildContext context) {
return Center(
child: Column(
mainAxisAlignment: MainAxisAlignment.center,
mainAxisSize: MainAxisSize.min,
children: [
SizedBox(
width: size,
height: size,
child: CircularProgressIndicator(
color: color ?? Theme.of(context).colorScheme.primary,
strokeWidth: 3.0,
),
),
if (message != null) ...[
const SizedBox(height: 16),
Text(
message!,
style: Theme.of(context).textTheme.bodyMedium?.copyWith(
color: Theme.of(context).colorScheme.onSurface.withOpacity(0.7),
),
textAlign: TextAlign.center,
),
],
],
),
);
}
}
/// A small loading indicator for buttons
class SmallLoadingIndicator extends StatelessWidget {
final Color? color;
final double size;
const SmallLoadingIndicator({
super.key,
this.color,
this.size = 16.0,
});
@override
Widget build(BuildContext context) {
return SizedBox(
width: size,
height: size,
child: CircularProgressIndicator(
color: color ?? Theme.of(context).colorScheme.onPrimary,
strokeWidth: 2.0,
),
);
}
}