ZetaAvatar.fromName constructor

ZetaAvatar.fromName({
  1. Key? key,
  2. required String name,
  3. ZetaAvatarSize size = ZetaAvatarSize.xl,
  4. Widget? lowerBadge,
  5. Widget? upperBadge,
  6. Color? borderColor,
  7. Color? backgroundColor,
  8. String? semanticLabel = 'avatar',
  9. String? semanticUpperBadgeLabel = 'upperBadge',
  10. String? semanticLowerBadgeLabel = 'lowerBadge',
  11. TextStyle? initialTextStyle,
  12. String? label,
  13. TextStyle? labelTextStyle,
  14. int labelMaxLines = 1,
  15. VoidCallback? onTap,
})

Constructor for ZetaAvatar with initials from a full name.

Implementation

ZetaAvatar.fromName({
  super.key,
  required String name,
  this.size = ZetaAvatarSize.xl,
  this.lowerBadge,
  this.upperBadge,
  this.borderColor,
  this.backgroundColor,
  this.semanticLabel = 'avatar',
  this.semanticUpperBadgeLabel = 'upperBadge',
  this.semanticLowerBadgeLabel = 'lowerBadge',
  this.initialTextStyle,
  this.label,
  this.labelTextStyle,
  this.labelMaxLines = 1,
  this.onTap,
})  : image = null,
      initials = name.initials;