invoke method
Future<bool>
invoke({
- required dynamic onResult(
- T extractionResult
- required dynamic onFailure(),
- required dynamic onUploadProgress(),
- required dynamic onUploadingDone(),
Implementation
Future<bool> invoke(
{required Function(T extractionResult) onResult,
required Function(DigifiedError) onFailure,
required Function(int, int) onUploadProgress,
required Function(int) onUploadingDone}) async {
_onResult = onResult;
_onFailure = onFailure;
_onUploadProgress = onUploadProgress;
_onUploadingDone = onUploadingDone;
switch (T) {
case IdExtractionResult:
sendType = SendConstants.egyptianId;
break;
case GenericIdExtractionResult:
sendType = SendConstants.genericId;
break;
case PassportExtractionResult:
sendType = SendConstants.passport;
break;
case VehicleLicenseExtractionResult:
sendType = SendConstants.vehicleLicense;
break;
default: //
sendType = SendConstants.selfie;
break;
}
return sendToNative({
SendConstants.sendType: sendType
});
}