signOut method

  1. @override
Future<SignOutResult> signOut({
  1. SignOutRequest? request,
})

Implementation

@override
Future<SignOutResult> signOut({SignOutRequest? request}) async {
  try {
    final Map<String, dynamic>? data =
        (await (_channel.invokeMapMethod<String, dynamic>(
      'signOut',
      <String, dynamic>{
        'data': request != null ? request.serializeAsMap() : {},
      },
    )));
    if (data == null)
      throw AmplifyException(
          AmplifyExceptionMessages.nullReturnedFromMethodChannel);
    return _formatSignOutResponse(data);
  } on PlatformException catch (e) {
    throw castAndReturnPlatformException(e);
  }
}