DescopeFlowConfig.hosted constructor

DescopeFlowConfig.hosted(
  1. String flowId, {
  2. DescopeSdk? sdk,
})

Creates a DescopeFlowConfig with a URL built from the flow ID, for use with Descope's Flow hosting service.

Use the cascade operator to set additional options:

DescopeFlowConfig.hosted('sign-in')
  ..androidOAuthNativeProvider = 'google'
  ..iosOAuthNativeProvider = 'apple'

The optional sdk parameter can be provided to use a specific DescopeSdk instance instead of the Descope singleton.

Implementation

factory DescopeFlowConfig.hosted(String flowId, {DescopeSdk? sdk}) {
  final config = (sdk ?? globalSdk).config;
  final baseUrl = config.baseUrl ?? baseUrlForProjectId(config.projectId);
  return DescopeFlowConfig(url: '$baseUrl/login/${config.projectId}?wide=true&platform=mobile&flow=$flowId');
}