import 'package:flutter/material.dart'; import '../../data/models/models.dart'; import '../theme/app_theme.dart'; class StepIndicator extends StatelessWidget { final BatchStep currentStep; const StepIndicator({super.key, required this.currentStep}); @override Widget build(BuildContext context) { final steps = BatchStep.values; return Container( color: Colors.white, padding: const EdgeInsets.symmetric(vertical: 8), child: Row( mainAxisAlignment: MainAxisAlignment.center, children: steps.map((step) { final isActive = step == currentStep; final isDone = step.index < currentStep.index; return Expanded( child: Column( mainAxisSize: MainAxisSize.min, children: [ _StepDot(isActive: isActive, isDone: isDone, step: step), const SizedBox(height: 4), Text( step.label, style: TextStyle( fontSize: 10, fontWeight: isActive ? FontWeight.w700 : FontWeight.w400, color: isActive ? AppColors.primary : isDone ? AppColors.success : AppColors.textSecondary, ), textAlign: TextAlign.center, ), ], ), ); }).toList(), ), ); } } class _StepDot extends StatelessWidget { final bool isActive; final bool isDone; final BatchStep step; const _StepDot({required this.isActive, required this.isDone, required this.step}); @override Widget build(BuildContext context) { return Container( width: 28, height: 28, decoration: BoxDecoration( shape: BoxShape.circle, color: isActive ? AppColors.primary : isDone ? AppColors.success : AppColors.divider, ), child: Center( child: isDone ? const Icon(Icons.check, color: Colors.white, size: 16) : Text( '${step.index + 1}', style: TextStyle( color: isActive ? Colors.white : AppColors.textSecondary, fontSize: 13, fontWeight: FontWeight.w600, ), ), ), ); } }