Skip to content

Commit bd8baaf

Browse files
committed
WIP: add CustomIsolateEvent class
1 parent 5eaa606 commit bd8baaf

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

lib/services/connection/api_manager/isolate_events.dart

+46
Original file line numberDiff line numberDiff line change
@@ -82,3 +82,49 @@ class IsolateResponse<T> {
8282
@override
8383
String toString() => 'ResponseEvent: [$eventId]: $response';
8484
}
85+
86+
/// To communicate event and get the response for custom events that in addition
87+
/// to get the BE JSON the deserialization of the JSON response to dart models
88+
/// also happens inside the isolate.
89+
abstract class CustomIsolateEvent<T> extends _IsolateEvent {
90+
CustomIsolateEvent({
91+
required super.eventId,
92+
required this.event,
93+
required this.request,
94+
this.data,
95+
});
96+
97+
final CustomEvent event;
98+
99+
final Request request;
100+
101+
final T? data;
102+
}
103+
104+
enum CustomEvent {
105+
ping,
106+
activeSymbols,
107+
assetIndex,
108+
balance,
109+
buy,
110+
accountList,
111+
accountClosure,
112+
cancel,
113+
cashierPayment,
114+
changeEmail,
115+
changePassword,
116+
confirmEmail,
117+
contractUpdateHistory,
118+
contractUpdate,
119+
contractsFor,
120+
getAccountStatus,
121+
getAccountTypes,
122+
getAvailableAccounts,
123+
getFinancialAssessment,
124+
getLimits,
125+
getSelfExclusion,
126+
getSettings,
127+
identityVerification,
128+
jTokenCreate,
129+
kycAuthStatus,
130+
}

0 commit comments

Comments
 (0)