Avatar constructor
Avatar({
- Object? text,
- Object? imageUrl,
- double size = 40,
- ColorToken? backgroundColor,
- ColorToken? textColor,
- String? name,
- 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));