From 3a794d7a2bdccddca2e8a20041da0b016d580f3d Mon Sep 17 00:00:00 2001 From: shenlong <139912620+shenlong-tanwen@users.noreply.github.com> Date: Sun, 10 Dec 2023 02:32:39 +0000 Subject: [PATCH] fix: use avatarColor as the text background when no avatar available (#5566) Co-authored-by: shenlong-tanwen <139912620+shalong-tanwen@users.noreply.github.com> --- mobile/lib/shared/ui/user_circle_avatar.dart | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/mobile/lib/shared/ui/user_circle_avatar.dart b/mobile/lib/shared/ui/user_circle_avatar.dart index 1f6ef15f50..4ad80dc31d 100644 --- a/mobile/lib/shared/ui/user_circle_avatar.dart +++ b/mobile/lib/shared/ui/user_circle_avatar.dart @@ -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,