2020-11-12 16:32:10 +00:00
|
|
|
import 'package:photos/events/event.dart';
|
|
|
|
|
|
|
|
class SyncStatusUpdate extends Event {
|
2020-06-15 18:42:25 +00:00
|
|
|
final int completed;
|
|
|
|
final int total;
|
2020-09-17 19:40:08 +00:00
|
|
|
final bool wasStopped;
|
2020-11-15 07:19:51 +00:00
|
|
|
final SyncStatus status;
|
2020-11-16 16:35:16 +00:00
|
|
|
final String reason;
|
2021-02-02 16:57:16 +00:00
|
|
|
final Error error;
|
2021-04-27 21:43:51 +00:00
|
|
|
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
|
|
|
}) {
|
|
|
|
this.timestamp = DateTime.now().microsecondsSinceEpoch;
|
|
|
|
}
|
2021-03-03 04:28:49 +00:00
|
|
|
|
|
|
|
@override
|
|
|
|
String toString() {
|
|
|
|
return 'SyncStatusUpdate(completed: $completed, total: $total, wasStopped: $wasStopped, status: $status, reason: $reason, error: $error)';
|
|
|
|
}
|
2020-06-15 18:42:25 +00:00
|
|
|
}
|
2020-11-15 07:19:51 +00:00
|
|
|
|
|
|
|
enum SyncStatus {
|
2021-04-05 12:47:31 +00:00
|
|
|
started_first_gallery_import,
|
|
|
|
completed_first_gallery_import,
|
2020-12-03 21:47:06 +00:00
|
|
|
applying_remote_diff,
|
|
|
|
preparing_for_upload,
|
2020-11-15 07:19:51 +00:00
|
|
|
in_progress,
|
2020-11-16 16:35:16 +00:00
|
|
|
paused,
|
2021-04-06 23:33:41 +00:00
|
|
|
completed_backup,
|
2020-11-15 07:19:51 +00:00
|
|
|
error,
|
|
|
|
}
|