TokenClientConfig constructor

TokenClientConfig({
  1. required String client_id,
  2. required TokenClientCallbackFn callback,
  3. required List<String> scope,
  4. bool? include_granted_scopes,
  5. String? prompt,
  6. bool? enable_granular_consent,
  7. @Deprecated('Use `enable_granular_consent` instead.') bool? enable_serial_consent,
  8. String? login_hint,
  9. String? hd,
  10. String? state,
  11. ErrorCallbackFn? error_callback,
})

Constructs a TokenClientConfig object in JavaScript.

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

Implementation

factory TokenClientConfig({
  required String client_id,
  required TokenClientCallbackFn callback,
  required List<String> scope,
  bool? include_granted_scopes,
  String? prompt,
  bool? enable_granular_consent,
  @Deprecated('Use `enable_granular_consent` instead.')
  bool? enable_serial_consent,
  String? login_hint,
  String? hd,
  String? state,
  ErrorCallbackFn? error_callback,
}) {
  assert(scope.isNotEmpty);
  return TokenClientConfig._toJS(
    client_id: client_id.toJS,
    callback: callback.toJS,
    scope: scope.join(' ').toJS,
    include_granted_scopes: include_granted_scopes?.toJS,
    prompt: prompt?.toJS,
    enable_granular_consent: enable_granular_consent?.toJS,
    enable_serial_consent: enable_serial_consent?.toJS,
    login_hint: login_hint?.toJS,
    hd: hd?.toJS,
    state: state?.toJS,
    error_callback: error_callback?.toJS,
  );
}