Update: 2026-05-07 03:06:15

This commit is contained in:
Hamza-Ayed
2026-05-07 03:06:15 +03:00
parent 272971fc5b
commit bfb6368ec8
28 changed files with 3292 additions and 188 deletions

View File

@@ -0,0 +1,48 @@
import 'package:get/get.dart';
class UploadProgressService extends GetxService {
var isUploading = false.obs;
var progress = 0.0.obs;
var companyName = ''.obs;
var totalImages = 0.obs;
var currentImageIndex = 0.obs;
var status = 'uploading'.obs; // uploading, processing, done
void startUpload(String company, int total) {
isUploading.value = true;
companyName.value = company;
totalImages.value = total;
currentImageIndex.value = 0;
progress.value = 0.0;
status.value = 'uploading';
}
void updateProgress(double p, int current) {
progress.value = p;
currentImageIndex.value = current;
}
void startProcessing() {
status.value = 'processing';
progress.value = 0.5; // generic progress for processing until FCM hits
}
void updateProcessingProgress(int processed, int total) {
status.value = 'processing';
progress.value = processed / total;
currentImageIndex.value = processed;
totalImages.value = total;
}
void complete() {
status.value = 'done';
progress.value = 1.0;
Future.delayed(const Duration(seconds: 3), () {
isUploading.value = false;
});
}
void fail() {
isUploading.value = false;
}
}