CognitoUser constructor

CognitoUser(
  1. String? username,
  2. CognitoUserPool pool, {
  3. dynamic clientSecret,
  4. CognitoStorage? storage,
  5. String? deviceName = 'Dart-device',
  6. dynamic signInUserSession,
  7. ParamsDecorator? analyticsMetadataParamsDecorator,
})

Implementation

CognitoUser(
  this.username,
  this.pool, {
  clientSecret,
  CognitoStorage? storage,
  this.deviceName = 'Dart-device',
  signInUserSession,
  ParamsDecorator? analyticsMetadataParamsDecorator,
}) : _analyticsMetadataParamsDecorator =
          analyticsMetadataParamsDecorator ?? NoOpsParamsDecorator() {
  if (clientSecret != null) {
    _clientSecret = clientSecret;
    _clientSecretHash = calculateClientSecretHash(
      username!,
      pool.getClientId()!,
      _clientSecret!,
    );
  }
  if (signInUserSession != null) {
    _signInUserSession = signInUserSession;
  }
  client = pool.client;
  authenticationFlowType = 'USER_SRP_AUTH';

  this.storage = storage ??= pool.storage;
  pool.storage = this.storage;
}