loading state and error handling refactor

This commit is contained in:
2026-05-06 10:11:45 +02:00
parent 2c376afd91
commit 4b1d4379a0
48 changed files with 1377 additions and 354 deletions
+35
View File
@@ -0,0 +1,35 @@
import 'package:flutter/material.dart';
class AppProgressIndicator extends StatelessWidget {
final double size;
final double strokeWidth;
final Color? color;
const AppProgressIndicator._({
required this.size,
required this.strokeWidth,
this.color,
});
const AppProgressIndicator.small({Color? color})
: this._(size: 16, strokeWidth: 2, color: color);
const AppProgressIndicator.medium({Color? color})
: this._(size: 24, strokeWidth: 2.5, color: color);
const AppProgressIndicator.large({Color? color})
: this._(size: 40, strokeWidth: 3, color: color);
@override
Widget build(BuildContext context) {
final resolved = color ?? Theme.of(context).colorScheme.primary;
return SizedBox(
width: size,
height: size,
child: CircularProgressIndicator(
strokeWidth: strokeWidth,
valueColor: AlwaysStoppedAnimation<Color>(resolved),
),
);
}
}