copyWith method

  1. @override
IdentityState copyWith({
  1. Set<LoadingState>? loadingStates,
  2. Set<Message>? messages,
  3. Session? session,
  4. bool? isLoggedIn,
  5. User? user,
  6. String? accessToken,
  7. Verification? awaitingVerification,
  8. dynamic resetAwaitingVerification = false,
  9. AuthType? awaitingLogin,
  10. dynamic resetAwaitingLogin = false,
  11. String? totpSetupSecret,
  12. Uri? totpSetupUri,
  13. dynamic resetTOTPSetup = false,
})
override

The concrete class must implement this method to return a new instance of the state with the given parameters.

Implementation

@override
IdentityState copyWith({
  Set<LoadingState>? loadingStates,
  Set<Message>? messages,
  Session? session,
  bool? isLoggedIn,
  User? user,
  String? accessToken,
  Verification? awaitingVerification,
  resetAwaitingVerification = false,
  AuthType? awaitingLogin,
  resetAwaitingLogin = false,
  String? totpSetupSecret,
  Uri? totpSetupUri,
  resetTOTPSetup = false,
}) {
  return IdentityState(
    loadingStates: loadingStates ?? super.loadingStates,
    messages: messages ?? super.messages,
    session: session ?? this.session,
    isLoggedIn: isLoggedIn ?? this.isLoggedIn,
    user: user ?? this.user,
    accessToken: accessToken ?? this.accessToken,
    awaitingVerification: //
        resetAwaitingVerification //
            ? null
            : awaitingVerification ?? this.awaitingVerification,
    awaitingLogin: //
        resetAwaitingLogin //
            ? null
            : awaitingLogin ?? this.awaitingLogin,
    totpSetupSecret: //
        resetTOTPSetup //
            ? null
            : totpSetupSecret ?? this.totpSetupSecret,
    totpSetupUri: //
        resetTOTPSetup //
            ? null
            : totpSetupUri ?? this.totpSetupUri,
  );
}