logout method

Future logout(
  1. BuildContext context
)

Initiates logout.

context: The BuildContext to navigate to the authentication view.

Implementation

Future logout(BuildContext context) async {
  String url =
      "${Const.baseUrl(_isProduction)}/idshub/logout?redirect_uri=$_redirectUri/cancelled";
  if (context.mounted) {
    return await Navigator.push(
      context,
      MaterialPageRoute(
        builder: (context) => UaePassLoginView(
          url: url,
          urlScheme: _appScheme,
          isProduction: _isProduction,
        ),
      ),
    );
  }

  return null;
}