copyWith method

User copyWith({
  1. String? id,
  2. String? picture,
  3. DateTime? memberSince,
  4. int? following,
  5. int? followers,
  6. String? about,
})

Builds a copy of a User

  • id: The id of the user
  • picture: A link to the user picture
  • memberSince: The user join date
  • following: The number of users this user is following
  • followers: The number of followers this user has
  • about: More about the user

Implementation

User copyWith(
    {String? id,
    String? picture,
    DateTime? memberSince,
    int? following,
    int? followers,
    String? about}) {
  return User(
      id: id ?? this.id,
      picture: picture ?? this.picture,
      memberSince: memberSince ?? this.memberSince,
      following: following ?? this.following,
      followers: followers ?? this.followers,
      about: about ?? this.about);
}