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