buildOAuthFlow static method

Widget buildOAuthFlow({
  1. required OAuthProvider provider,
  2. required void onCompleted(
    1. AuthorizationTokenResponse result
    ),
  3. VoidCallback? onCancelled,
  4. void onError(
    1. Object error
    )?,
  5. Widget? loadingWidget,
  6. Color? backgroundColor,
})

Builds an OAuth WebView widget that emits callbacks for authorization lifecycle events.

This allows embedding the OAuth flow directly inside widget trees without relying on Navigator pushes. When callbacks are not supplied, the widget retains its default behaviour.

Implementation

static Widget buildOAuthFlow({
  required OAuthProvider provider,
  required void Function(AuthorizationTokenResponse result) onCompleted,
  VoidCallback? onCancelled,
  void Function(Object error)? onError,
  Widget? loadingWidget,
  Color? backgroundColor,
}) {
  return OAuthWebView(
    provider: provider,
    loadingWidget: loadingWidget,
    backgroundColor: backgroundColor,
    onAuthorizationCompleted: onCompleted,
    onAuthorizationCancelled: onCancelled,
    onAuthorizationError: onError,
  );
}