copyWith method

ZetaAvatar copyWith({
  1. ZetaAvatarSize? size,
  2. Widget? image,
  3. String? initials,
  4. Color? backgroundColor,
  5. Color? borderColor,
  6. ZetaAvatarBadge? lowerBadge,
  7. ZetaAvatarBadge? upperBadge,
})

Return copy of avatar with certain changed fields

Implementation

ZetaAvatar copyWith({
  ZetaAvatarSize? size,
  Widget? image,
  String? initials,
  Color? backgroundColor,
  Color? borderColor,
  ZetaAvatarBadge? lowerBadge,
  ZetaAvatarBadge? upperBadge,
}) {
  return ZetaAvatar(
    size: size ?? this.size,
    image: image ?? this.image,
    initials: initials ?? this.initials,
    backgroundColor: backgroundColor ?? this.backgroundColor,
    borderColor: borderColor ?? this.borderColor,
    lowerBadge: lowerBadge ?? this.lowerBadge,
    upperBadge: upperBadge ?? this.upperBadge,
  );
}