initialize method

void initialize({
  1. required bool showCompletionView,
  2. required VoidCallback completion,
  3. VoidCallback? onCompleted,
  4. VoidCallback? onCancelled,
  5. dynamic onError(
    1. String
    )?,
  6. Branding? branding,
  7. required BuildContext context,
})

Implementation

void initialize({
  required bool showCompletionView,
  required VoidCallback completion,
  VoidCallback? onCompleted,
  VoidCallback? onCancelled,
  Function(String)? onError,
  Branding? branding,
  required BuildContext context
}) {
  _showCompletionView = showCompletionView;
  _completion = completion;
  _onCompletedCallback = onCompleted;
  _onCancelledCallback = onCancelled;
  _onErrorCallback = onError;
  _context = context;

  state = state.copyWith(
    branding: branding,
  );

  final webSocketManager = _ref.read(webSocketManagerProvider.notifier);
  webSocketManager.onPreflightResponse = handleApiNavigation;
}