2020-11-12 16:32:10 +00:00
|
|
|
import 'package:photos/events/event.dart';
|
|
|
|
|
|
|
|
class SyncStatusUpdate extends Event {
|
2020-11-15 07:19:51 +00:00
|
|
|
final SyncStatus status;
|
2022-09-21 12:13:46 +00:00
|
|
|
final int? completed;
|
|
|
|
final int? total;
|
|
|
|
final bool wasStopped;
|
2020-11-16 16:35:16 +00:00
|
|
|
final String reason;
|
2022-09-21 12:13:46 +00:00
|
|
|
final Error? error;
|
|
|
|
late int timestamp;
|
2020-06-15 18:42:25 +00:00
|
|
|
|
2020-11-15 07:19:51 +00:00
|
|
|
SyncStatusUpdate(
|
|
|
|
this.status, {
|
2020-09-17 19:40:08 +00:00
|
|
|
this.completed,
|
|
|
|
this.total,
|
|
|
|
this.wasStopped = false,
|
2020-11-16 16:35:16 +00:00
|
|
|
this.reason = "",
|
2021-02-02 16:57:16 +00:00
|
|
|
this.error,
|
2021-04-27 21:43:51 +00:00
|
|
|
}) {
|
2021-07-22 18:41:58 +00:00
|
|
|
timestamp = DateTime.now().microsecondsSinceEpoch;
|
2021-04-27 21:43:51 +00:00
|
|
|
}
|
2020-06-15 18:42:25 +00:00
|
|
|
}
|
2020-11-15 07:19:51 +00:00
|
|
|
|
|
|
|
enum SyncStatus {
|
2022-07-03 07:47:15 +00:00
|
|
|
startedFirstGalleryImport,
|
|
|
|
completedFirstGalleryImport,
|
|
|
|
applyingRemoteDiff,
|
|
|
|
preparingForUpload,
|
|
|
|
inProgress,
|
2020-11-16 16:35:16 +00:00
|
|
|
paused,
|
2022-07-03 07:47:15 +00:00
|
|
|
completedBackup,
|
2020-11-15 07:19:51 +00:00
|
|
|
error,
|
|
|
|
}
|