startSDK method
Implementation
@override
Future<BlusaltIdentityResultResponse> startSDK(
BlusaltIdentityType identityType) async {
try {
final result =
await methodChannel.invokeMethod('startIdentityVerification', {
'apiKey': _apiKey,
'appName': _appName,
'clientId': _clientID,
'isDev': _isDev,
'documentTypeValue': identityType.value.toLowerCase()
});
if (result != null) {
return BlusaltIdentityResultResponse.fromJson(json.decode(result),
identityResultType: BlusaltIdentityResultType.success);
} else {
return BlusaltIdentityResultResponse(
identityResultType: BlusaltIdentityResultType.error,
message: "Something went wrong");
}
} on PlatformException catch (exception) {
return BlusaltIdentityResultResponse(
identityResultType: BlusaltIdentityResultType.error,
exception: exception,
message: exception.message);
} catch (e) {
return BlusaltIdentityResultResponse(
identityResultType: BlusaltIdentityResultType.error,
message: e.toString());
}
}