executeSyncOperation method
Future<void>
executeSyncOperation({})
Method for executing an operation synchronously.
Implementation
Future<void> executeSyncOperation({
required String operationSystemName,
required Map<String, dynamic> operationBody,
required Function(String success) onSuccess,
required Function(MindboxError) onError,
}) async {
if (_initialized) {
channel.invokeMethod('executeSyncOperation', [
operationSystemName,
jsonEncode(operationBody),
]).then((result) {
onSuccess(result);
}, onError: (e) {
final mindboxError = _convertPlatformExceptionToMindboxError(e);
onError(mindboxError);
});
} else {
_pendingOperations.add(_PendingOperations(
methodName: 'executeSyncOperation',
parameters: [operationSystemName, jsonEncode(operationBody)],
successCallback: onSuccess,
errorCallback: onError,
));
}
}