initialize method
Future<bool>
initialize({})
Initializing the SDK and setting some config params
baseUrl
(required) https url of the backend hosting Digified APIapiKey
(required) API Key of the Digified APIenableManualCapturingFallback
(optional) Enables fallback to manual capturing after a default or a custom timeoutcaptureTimeout
(optional) Setting the capture timeoutmaxCapturingWidth
(optional) maximum width of the output imagemaxCapturingHeight
(optional) maximum height of the output imagewarningAction
(optional) setting the warning action for the api (optional - set to null if you will not use it)userName
(optional) name of the user (optional - set to if you will not use it)phoneNumber
(optional) user's phone number (optional - set to null if you will not use it)email
(optional) user's email (optional - set to null if you will not use it)onSuccess
(required) Function that is called if the initialization succeeds, you can get InitializationResult from itonFailed
(required) Function that is called if the initialization fails, you can get DigifiedError from it
Implementation
Future<bool> initialize(
{required String baseUrl,
required String apiKey,
bool? enableManualCapturingFallback,
int? captureTimeout,
int? maxCapturingWidth,
int? maxCapturingHeight,
String? warningAction,
String? userName,
String? phoneNumber,
String? email,
required void Function(InitializationResult) onSuccess,
required void Function(DigifiedError) onFailed}) async {
_isInitializeCalled = true;
return InitializeMethod().invoke(
baseUrl: baseUrl,
apiKey: apiKey,
enableManualCapturingFallback: enableManualCapturingFallback,
captureTimeout: captureTimeout,
maxCapturingWidth: maxCapturingWidth,
maxCapturingHeight: maxCapturingHeight,
warningAction: warningAction,
userName: userName,
phoneNumber: phoneNumber,
email: email,
onSuccess: onSuccess,
onFailed: onFailed);
}