CodeClientConfig constructor

CodeClientConfig({
  1. required String client_id,
  2. required List<String> scope,
  3. bool? include_granted_scopes,
  4. Uri? redirect_uri,
  5. CodeClientCallbackFn? callback,
  6. String? state,
  7. bool? enable_granular_consent,
  8. @Deprecated('Use `enable_granular_consent` instead.') bool? enable_serial_consent,
  9. String? login_hint,
  10. String? hd,
  11. UxMode? ux_mode,
  12. bool? select_account,
  13. ErrorCallbackFn? error_callback,
})

Constructs a CodeClientConfig object in JavaScript.

The callback property must be a Dart function and not a JS function.

Implementation

factory CodeClientConfig({
  required String client_id,
  required List<String> scope,
  bool? include_granted_scopes,
  Uri? redirect_uri,
  CodeClientCallbackFn? callback,
  String? state,
  bool? enable_granular_consent,
  @Deprecated('Use `enable_granular_consent` instead.')
  bool? enable_serial_consent,
  String? login_hint,
  String? hd,
  UxMode? ux_mode,
  bool? select_account,
  ErrorCallbackFn? error_callback,
}) {
  assert(scope.isNotEmpty);
  return CodeClientConfig._toJS(
    client_id: client_id.toJS,
    scope: scope.join(' ').toJS,
    include_granted_scopes: include_granted_scopes?.toJS,
    redirect_uri: redirect_uri?.toString().toJS,
    callback: callback?.toJS,
    state: state?.toJS,
    enable_granular_consent: enable_granular_consent?.toJS,
    enable_serial_consent: enable_serial_consent?.toJS,
    login_hint: login_hint?.toJS,
    hd: hd?.toJS,
    ux_mode: ux_mode.toString().toJS,
    select_account: select_account?.toJS,
    error_callback: error_callback?.toJS,
  );
}