copyWith method

RaliUser copyWith({
  1. String? displayName,
  2. String? email,
  3. String? photoURL,
  4. Map<String, dynamic>? preferences,
  5. List<Map<String, dynamic>>? savedDestinations,
  6. List<String>? savedRoutes,
  7. Timestamp? lastLogin,
})

Creates a copy of this RaliUser with optional parameter updates

Implementation

RaliUser copyWith({
  String? displayName,
  String? email,
  String? photoURL,
  Map<String, dynamic>? preferences,
  List<Map<String, dynamic>>? savedDestinations,
  List<String>? savedRoutes,
  Timestamp? lastLogin,
}) {
  return RaliUser(
    uid: uid,
    displayName: displayName ?? this.displayName,
    email: email ?? this.email,
    photoURL: photoURL ?? this.photoURL,
    preferences: preferences ?? this.preferences,
    savedDestinations: savedDestinations ?? this.savedDestinations,
    savedRoutes: savedRoutes ?? this.savedRoutes,
    createdAt: createdAt,
    lastLogin: lastLogin ?? this.lastLogin,
  );
}