mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
opt.
This commit is contained in:
@@ -12,11 +12,22 @@ class Server {
|
||||
}
|
||||
|
||||
enum ServerState {
|
||||
failed,
|
||||
disconnected,
|
||||
connecting,
|
||||
connected,
|
||||
failed;
|
||||
|
||||
bool get shouldConnect =>
|
||||
this == ServerState.disconnected || this == ServerState.failed;
|
||||
/// Connected to server
|
||||
connected,
|
||||
|
||||
/// Status parsing
|
||||
loading,
|
||||
|
||||
/// Status parsing finished
|
||||
finished;
|
||||
|
||||
bool get shouldConnect => this < ServerState.connecting;
|
||||
|
||||
bool get canViewDetails => this == ServerState.finished;
|
||||
|
||||
operator <(ServerState other) => index < other.index;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user