feat: enhance upload progress overlay with overall progress calculation and loading indicator

Changed files
+26 -6
lib
+26 -6
lib/widgets/upload_progress_overlay.dart
··· 26 // Get the current image being uploaded 27 final currentImage = currentIndex < images.length ? images[currentIndex] : null; 28 29 return Material( 30 color: Colors.transparent, 31 child: Stack( ··· 38 mainAxisSize: MainAxisSize.min, 39 mainAxisAlignment: MainAxisAlignment.center, 40 children: [ 41 - Text( 42 - 'Uploading photos...', 43 - style: theme.textTheme.titleMedium?.copyWith(color: Colors.white), 44 ), 45 const SizedBox(height: 16), 46 ··· 56 57 const SizedBox(height: 16), 58 59 - // Progress indicator 60 SizedBox( 61 width: 300, 62 child: LinearProgressIndicator( 63 - value: progress, 64 backgroundColor: theme.colorScheme.surfaceContainerHighest.withOpacity(0.5), 65 valueColor: AlwaysStoppedAnimation<Color>(theme.colorScheme.primary), 66 ), ··· 70 71 // Position counter and progress percentage 72 Text( 73 - '${currentIndex + 1} of ${images.length} • ${(progress * 100).toInt()}%', 74 style: theme.textTheme.bodyMedium?.copyWith(color: Colors.white70), 75 ), 76 ],
··· 26 // Get the current image being uploaded 27 final currentImage = currentIndex < images.length ? images[currentIndex] : null; 28 29 + // Calculate overall progress: completed images + current image's progress 30 + double overallProgress = 0.0; 31 + if (images.isNotEmpty) { 32 + overallProgress = (currentIndex + progress) / images.length; 33 + } 34 + 35 return Material( 36 color: Colors.transparent, 37 child: Stack( ··· 44 mainAxisSize: MainAxisSize.min, 45 mainAxisAlignment: MainAxisAlignment.center, 46 children: [ 47 + Row( 48 + mainAxisSize: MainAxisSize.min, 49 + children: [ 50 + SizedBox( 51 + width: 24, 52 + height: 24, 53 + child: CircularProgressIndicator( 54 + strokeWidth: 2.5, 55 + valueColor: AlwaysStoppedAnimation<Color>(Colors.white), 56 + ), 57 + ), 58 + const SizedBox(width: 12), 59 + Text( 60 + 'Uploading photos...', 61 + style: theme.textTheme.titleMedium?.copyWith(color: Colors.white), 62 + ), 63 + ], 64 ), 65 const SizedBox(height: 16), 66 ··· 76 77 const SizedBox(height: 16), 78 79 + // Progress indicator (overall progress) 80 SizedBox( 81 width: 300, 82 child: LinearProgressIndicator( 83 + value: overallProgress, 84 backgroundColor: theme.colorScheme.surfaceContainerHighest.withOpacity(0.5), 85 valueColor: AlwaysStoppedAnimation<Color>(theme.colorScheme.primary), 86 ), ··· 90 91 // Position counter and progress percentage 92 Text( 93 + '${currentIndex + 1} of ${images.length} • ${(overallProgress * 100).toInt()}%', 94 style: theme.textTheme.bodyMedium?.copyWith(color: Colors.white70), 95 ), 96 ],