send<T extends DigifiedResult> method
Future<bool>
send<T extends DigifiedResult>({
- required dynamic onResult(
- T extractionResult
- required dynamic onFailure(),
- required dynamic onUploadProgress(),
- required dynamic onUploadingDone(),
Sending the captured image and get a result of T
that is specified in the Function
T
The result extending DigifiedResult, this is what you expect to get inonResult
onResult
(required) This function is called when the API request was successful and we have the response ofT
onFailure
(required) This function is called when there is a problem with the API call, and you will get DigifiedErroronUploadProgress
(required) This method is called when we the SDK sending and processing the API request, and you can get a DigifiedCaptureType as the first parameter and the second parameter is the progress asint
onUploadingDone
(required) This method is called when the uploading process of the image is done, so now the processing of the image has started and you will get the DigifiedCaptureType as a parameter
Implementation
Future<bool> send<T extends DigifiedResult>(
{required Function(T extractionResult) onResult,
required Function(DigifiedError) onFailure,
required Function(int, int) onUploadProgress,
required Function(int) onUploadingDone}) {
if (!_isInitializeCalled) {
debugPrint("Digifed: call initialize first!");
return Future.value(false);
}
return SendMethod<T>().invoke(
onResult: onResult,
onFailure: onFailure,
onUploadProgress: onUploadProgress,
onUploadingDone: onUploadingDone);
}