hostedAuthFinish method

  1. @override
Future<AuthResult> hostedAuthFinish(
  1. String code,
  2. String state
)
override

Implementation

@override
Future<AuthResult> hostedAuthFinish(String code, String state) async {
if (Platform.isIOS) {
  throw PassageError(
      code: PassageErrorCode.hostedAuthFinish,
      message: 'Not supported on iOS. Use hostedAuthIOS instead.');
}
try {
  final Map<Object?, Object?>? result = await methodChannel.invokeMethod<Map<Object?, Object?>>(
    'hostedAuthFinish',
    {'code': code, 'state': state},
  );
  final authResult = AuthResult.fromJson(result!['authResult']);
  return authResult;
} catch (e) {
  throw PassageError.fromObject(object: e);
}
}