copyWith method

NextAuthState<T> copyWith({
  1. Opt<T>? session,
  2. Opt<SessionStatus>? status,
})

Creates a copy of this state with the given fields replaced.

Use Opt.absent to keep the current value, or Opt(value) to update it.

Implementation

NextAuthState<T> copyWith({Opt<T>? session, Opt<SessionStatus>? status}) {
  return NextAuthState<T>(
    session: session == null ? this.session : session.value,
    status: status == null ? this.status : status.value!,
  );
}