mirror of
https://github.com/immich-app/immich.git
synced 2024-11-15 09:59:00 -07:00
fix: use avatarColor as the text background when no avatar available (#5566)
Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com>
This commit is contained in:
parent
68c0112aaa
commit
3a794d7a2b
@ -3,6 +3,7 @@ import 'dart:math';
|
||||
import 'package:cached_network_image/cached_network_image.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:hooks_riverpod/hooks_riverpod.dart';
|
||||
import 'package:immich_mobile/extensions/build_context_extensions.dart';
|
||||
import 'package:immich_mobile/shared/models/store.dart';
|
||||
import 'package:immich_mobile/shared/models/user.dart';
|
||||
import 'package:immich_mobile/shared/ui/transparent_image.dart';
|
||||
@ -34,15 +35,16 @@ class UserCircleAvatar extends ConsumerWidget {
|
||||
color: isDarkTheme && user.avatarColor == AvatarColorEnum.primary
|
||||
? Colors.black
|
||||
: Colors.white,
|
||||
backgroundColor: user.avatarColor.toColor(),
|
||||
),
|
||||
);
|
||||
return CircleAvatar(
|
||||
backgroundColor: user.avatarColor.toColor(),
|
||||
backgroundColor: context.primaryColor,
|
||||
radius: radius,
|
||||
child: user.profileImagePath.isEmpty
|
||||
? textIcon
|
||||
: ClipRRect(
|
||||
borderRadius: BorderRadius.circular(50),
|
||||
borderRadius: const BorderRadius.all(Radius.circular(50)),
|
||||
child: CachedNetworkImage(
|
||||
fit: BoxFit.cover,
|
||||
cacheKey: user.profileImagePath,
|
||||
|
Loading…
Reference in New Issue
Block a user