copyWith method

ReownAppKitModalSession copyWith({
  1. SessionData? sessionData,
  2. CoinbaseData? coinbaseData,
  3. MagicData? magicData,
  4. SIWESession? siweSession,
})

Implementation

ReownAppKitModalSession copyWith({
  SessionData? sessionData,
  CoinbaseData? coinbaseData,
  MagicData? magicData,
  SIWESession? siweSession,
}) {
  final newCoinbaseData = _coinbaseData?.copytWith(
    address: coinbaseData?.address,
    chainName: coinbaseData?.chainName,
    chainId: coinbaseData?.chainId,
    self: coinbaseData?.self,
    peer: coinbaseData?.peer,
  );
  final newMagicData = _magicData?.copytWith(
    email: magicData?.email,
    address: magicData?.address,
    chainId: magicData?.chainId,
    userName: magicData?.userName,
    smartAccountDeployed: magicData?.smartAccountDeployed,
    preferredAccountType: magicData?.preferredAccountType,
    self: magicData?.self,
    peer: magicData?.peer,
    provider: magicData?.provider,
  );
  return ReownAppKitModalSession(
    sessionData: sessionData ?? _sessionData,
    coinbaseData: newCoinbaseData ?? _coinbaseData,
    magicData: newMagicData ?? _magicData,
    siweSession: siweSession ?? _siweSession,
  );
}