progressIndicator static method
Glass progress indicator
Implementation
static Widget progressIndicator({
required double progress,
String? label,
GlassType type = GlassType.frosted,
Color? progressColor,
}) {
return GlassContainer.card(
type: type,
child: Column(
mainAxisSize: MainAxisSize.min,
children: [
if (label != null) ...[
Text(
label,
style: AppTextThemes.bodyMedium(
color: Colors.white,
fontWeight: FontWeight.w600,
),
),
SizedBox(height: 12.h),
],
Stack(
children: [
Container(
height: 8.h,
decoration: BoxDecoration(
color: Colors.white.withOpacity(0.2),
borderRadius: BorderRadius.circular(4.r),
),
),
FractionallySizedBox(
widthFactor: progress.clamp(0.0, 1.0),
child: Container(
height: 8.h,
decoration: BoxDecoration(
color: progressColor ?? Colors.white,
borderRadius: BorderRadius.circular(4.r),
),
),
),
],
),
SizedBox(height: 8.h),
Text(
'${(progress * 100).toInt()}%',
style: AppTextThemes.bodySmall(color: Colors.white70),
),
],
),
);
}