copyWith method
IdentityState
copyWith({
- Set<
LoadingState> ? loadingStates, - Set<
Message> ? messages, - Session? session,
- bool? isLoggedIn,
- User? user,
- String? accessToken,
- String? defaultOrgId,
- List<
String> ? orgMemberships, - String? defaultSpaceId,
- List<
String> ? spaceMemberships, - dynamic resetToken = false,
- Verification? awaitingVerification,
- dynamic resetAwaitingVerification = false,
- AuthType? awaitingLogin,
- dynamic resetAwaitingLogin = false,
- String? totpSetupSecret,
- Uri? totpSetupUri,
- 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,
String? defaultOrgId,
List<String>? orgMemberships,
String? defaultSpaceId,
List<String>? spaceMemberships,
resetToken = false,
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: resetToken //
? null
: accessToken ?? this.accessToken,
defaultOrgId: resetToken //
? null
: defaultOrgId ?? this.defaultOrgId,
orgMemberships: resetToken //
? null
: orgMemberships ?? this.orgMemberships,
defaultSpaceId: resetToken //
? null
: defaultSpaceId ?? this.defaultSpaceId,
spaceMemberships: resetToken //
? null
: spaceMemberships ?? this.spaceMemberships,
awaitingVerification: //
resetAwaitingVerification //
? null
: awaitingVerification ?? this.awaitingVerification,
awaitingLogin: //
resetAwaitingLogin //
? null
: awaitingLogin ?? this.awaitingLogin,
totpSetupSecret: //
resetTOTPSetup //
? null
: totpSetupSecret ?? this.totpSetupSecret,
totpSetupUri: //
resetTOTPSetup //
? null
: totpSetupUri ?? this.totpSetupUri,
);
}