Avatar constructor

Avatar({
  1. Object? text,
  2. Object? imageUrl,
  3. double size = 40,
  4. ColorToken? backgroundColor,
  5. ColorToken? textColor,
  6. String? name,
  7. Object? visible,
})

Implementation

Avatar({
  Object? text,
  Object? imageUrl,
  this.size = 40,
  this.backgroundColor,
  this.textColor,
  String? name,
  Object? visible,
}) : text = normalizeNullableExpression(text),
     imageUrl = normalizeNullableExpression(imageUrl),
     assert(
       text != null || imageUrl != null,
       'Avatar requires either text or imageUrl.',
     ),
     assert(
       text == null || imageUrl == null,
       'Avatar cannot set both text and imageUrl.',
     ),
     super(name: name, visible: _normalizeVisibility(visible));