rename AvatarOrHash.height to be more accurate
This commit is contained in:
parent
f23a29e7c1
commit
006008f61d
7 changed files with 14 additions and 14 deletions
|
|
@ -7,24 +7,24 @@ final class const AvatarOrHash(
|
|||
final Uri? avatar,
|
||||
final String title, {
|
||||
final Widget? fallback,
|
||||
final double height = 24,
|
||||
final double dimension = 24,
|
||||
super.key,
|
||||
}) extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) {
|
||||
final box = ColoredBox(
|
||||
color: ColorHash(title).color,
|
||||
child: Center(child: Icon(Icons.person, size: height / 2)),
|
||||
child: Center(child: Icon(Icons.person, size: dimension / 2)),
|
||||
);
|
||||
|
||||
return SizedBox(
|
||||
width: height,
|
||||
height: height,
|
||||
width: dimension,
|
||||
height: dimension,
|
||||
child: Center(
|
||||
child: ClipRRect(
|
||||
borderRadius: .all(.circular((height - 8) / 2.5)),
|
||||
borderRadius: .all(.circular((dimension - 8) / 2.5)),
|
||||
child: SizedBox.square(
|
||||
dimension: height,
|
||||
dimension: dimension,
|
||||
child: avatar == null
|
||||
? fallback ?? box
|
||||
: Image(
|
||||
|
|
|
|||
Loading…
Reference in a new issue