capture method
Future<bool>
capture({})
This method is used to capture images (ID front image, ID back image and Selfie)
captureType
(required) Specifies what you are capturing (ID Front, ID Back or Selfie) find the types here DigifiedCaptureTypedesiredWidth
(optional) desired image width (not guaranteed in order not to stretch the image, however SDK will not exceed that width)desiredHeight
(optional) desired image width (not guaranteed in order not to stretch the image, however SDK will not exceed that width)onCaptured
(required) This method is called when we have a successful CaptureResultonFailed
(required) This method is called when there is a problem with the capture request, DigifiedError and a DigifiedCaptureType can be obtainedonCancelled
(required) This method is called when the user pauses the app during capturing request, DigifiedCaptureType can be obtainedonTimeout
(required) This method is called if the time out of the capture process has passed
Implementation
Future<bool> capture(
{required int captureType,
int? desiredWidth,
int? desiredHeight,
required Function(CaptureResult) onCaptured,
required Function(DigifiedError, int) onFailed,
required Function(int) onCancelled,
required Function() onTimeout}) {
if (!_isInitializeCalled) {
debugPrint("Digifed: call initialize first!");
return Future.value(false);
}
return CaptureMethod().invoke(
captureType: captureType,
onCaptured: onCaptured,
onFailed: onFailed,
onCancelled: onCancelled,
onTimeout: onTimeout);
}