Skip to content

Commit 8f2f1e3

Browse files
committed
refactor: update data type for network payload
1 parent 5cc0a39 commit 8f2f1e3

File tree

2 files changed

+11
-3
lines changed

2 files changed

+11
-3
lines changed

lib/services/connection/call_manager/call_history.dart

+2-2
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ class CallHistory implements CallHistoryProvider {
4444
NetworkPayload(
4545
method: method,
4646
body: message,
47-
direction: 'RECEIVED',
47+
direction: NetworkDirections.received,
4848
timeStamp: timestamp),
4949
);
5050
}
@@ -65,7 +65,7 @@ class CallHistory implements CallHistoryProvider {
6565
NetworkPayload(
6666
method: method,
6767
body: message,
68-
direction: 'SENT',
68+
direction: NetworkDirections.sent,
6969
timeStamp: timestamp),
7070
);
7171
}

lib/services/interfaces/call_history_provider.dart

+9-1
Original file line numberDiff line numberDiff line change
@@ -22,8 +22,16 @@ class NetworkPayload {
2222
final Object body;
2323

2424
/// direction of the api i.e SENT or RECEIVED.
25-
final String direction;
25+
final NetworkDirections direction;
2626

2727
/// time of the api.
2828
final int timeStamp;
2929
}
30+
31+
enum NetworkDirections {
32+
/// Going out from the web socket.
33+
sent,
34+
35+
/// Coming in from the web socket.
36+
received
37+
}

0 commit comments

Comments
 (0)