mirror of
https://github.com/cake-tech/cake_wallet.git
synced 2024-12-24 12:39:37 +00:00
7d92a964c7
changed the status from "Starting sync" to "Attempting sync".
54 lines
No EOL
974 B
Dart
54 lines
No EOL
974 B
Dart
abstract class SyncStatus {
|
|
const SyncStatus();
|
|
double progress();
|
|
}
|
|
|
|
class SyncingSyncStatus extends SyncStatus {
|
|
SyncingSyncStatus(this.blocksLeft, this.ptc);
|
|
|
|
final double ptc;
|
|
final int blocksLeft;
|
|
|
|
@override
|
|
double progress() => ptc;
|
|
|
|
@override
|
|
String toString() => '$blocksLeft';
|
|
}
|
|
|
|
class SyncedSyncStatus extends SyncStatus {
|
|
@override
|
|
double progress() => 1.0;
|
|
}
|
|
|
|
class NotConnectedSyncStatus extends SyncStatus {
|
|
const NotConnectedSyncStatus();
|
|
|
|
@override
|
|
double progress() => 0.0;
|
|
}
|
|
|
|
class AttemptingSyncStatus extends SyncStatus {
|
|
@override
|
|
double progress() => 0.0;
|
|
}
|
|
|
|
class FailedSyncStatus extends SyncStatus {
|
|
@override
|
|
double progress() => 1.0;
|
|
}
|
|
|
|
class ConnectingSyncStatus extends SyncStatus {
|
|
@override
|
|
double progress() => 0.0;
|
|
}
|
|
|
|
class ConnectedSyncStatus extends SyncStatus {
|
|
@override
|
|
double progress() => 0.0;
|
|
}
|
|
|
|
class LostConnectionSyncStatus extends SyncStatus {
|
|
@override
|
|
double progress() => 1.0;
|
|
} |