forked from deriv-com/flutter-deriv-api
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathconnection_state.dart
68 lines (53 loc) · 1.87 KB
/
connection_state.dart
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
part of 'connection_cubit.dart';
/// Connection states base class.
@Deprecated('Use DerivConnectionState instead')
abstract class ConnectionState extends Equatable {
/// Initializes [ConnectionState].
const ConnectionState();
@override
String toString() => 'ConnectionState: $runtimeType';
@override
List<Object> get props => <Object>[];
}
/// Connection states base class.
abstract class DerivConnectionState extends ConnectionState {
/// Initializes [DerivConnectionState].
const DerivConnectionState();
@override
String toString() => 'DerivConnectionState: $runtimeType';
@override
List<Object> get props => <Object>[];
}
/// Connection initial state.
class ConnectionInitialState extends DerivConnectionState {
/// Initializes [ConnectionInitialState].
const ConnectionInitialState();
}
/// Shows that we are in the process of connecting.
class ConnectionConnectingState extends DerivConnectionState {
/// Initializes [ConnectionConnectingState].
const ConnectionConnectingState();
}
/// Connection connected state.
class ConnectionConnectedState extends DerivConnectionState {
/// Initializes [ConnectionConnectedState].
const ConnectionConnectedState();
}
/// Connection disconnected state.
class ConnectionDisconnectedState extends DerivConnectionState {
/// Initializes [ConnectionDisconnectedState].
const ConnectionDisconnectedState({this.isChangingLanguage = false});
/// Is the App language changing during connection change
final bool isChangingLanguage;
}
/// Connection error state.
class ConnectionErrorState extends DerivConnectionState {
/// Initializes with the this [error] message.
const ConnectionErrorState(this.error);
/// An exception or message from the server.
final String error;
@override
String toString() => 'ConnectionState: Error(error: $error)';
@override
List<Object> get props => <Object>[error];
}