Skip to content

Commit 963728a

Browse files
committed
WIP adding landing company
1 parent e0e2efb commit 963728a

File tree

2 files changed

+17
-0
lines changed

2 files changed

+17
-0
lines changed

lib/services/connection/api_manager/binary_api.dart

+1
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ import 'package:flutter_deriv_api/api/manually/tick.dart';
1212
import 'package:flutter_deriv_api/api/models/base_exception_model.dart';
1313
import 'package:flutter_deriv_api/api/response/active_symbols_response_result.dart';
1414
import 'package:flutter_deriv_api/api/response/authorize_response_result.dart';
15+
import 'package:flutter_deriv_api/api/response/landing_company_response_result.dart';
1516
import 'package:flutter_deriv_api/api/response/ticks_response_result.dart';
1617
import 'package:flutter_deriv_api/basic_api/generated/active_symbols_receive.dart';
1718
import 'package:flutter_deriv_api/basic_api/generated/active_symbols_send.dart';

lib/services/connection/api_manager/isolate_task.dart

+16
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,27 @@ void _handleCustomEvent(
157157

158158
sendPort.send(message.copyWith(data: response));
159159
case CustomEvent.landingCompany:
160+
await _fetchLandingCompnay(api, message, sendPort);
160161
case CustomEvent.statesList:
161162
case CustomEvent.residenceList:
162163
}
163164
}
164165

166+
Future<void> _fetchLandingCompnay(BinaryAPI api,
167+
CustomIsolateEvent<dynamic> message, SendPort sendPort) async {
168+
final LandingCompanyReceive response =
169+
await api.call(request: message.request);
170+
171+
checkException(
172+
response: response,
173+
exceptionCreator: ({BaseExceptionModel? baseExceptionModel}) =>
174+
BaseAPIException(baseExceptionModel: baseExceptionModel),
175+
);
176+
177+
sendPort.send(message.copyWith(
178+
data: LandingCompanyResponse.fromJson(response.landingCompany)));
179+
}
180+
165181
Future<void> _fetchActiveSymbols(
166182
BinaryAPI api,
167183
CustomIsolateEvent<dynamic> message,

0 commit comments

Comments
 (0)