Added some styling to the profile picture

This commit is contained in:
Alex
2023-02-12 13:34:20 -06:00
parent 6a7a4f98db
commit 0538f4478b
2 changed files with 18 additions and 9 deletions
@@ -51,10 +51,15 @@ class HomePageAppBar extends ConsumerWidget with PreferredSizeWidget {
Scaffold.of(context).openDrawer(); Scaffold.of(context).openDrawer();
}, },
child: CircleAvatar( child: CircleAvatar(
backgroundImage: CachedNetworkImageProvider( backgroundColor: Theme.of(context).primaryColor,
'$endpoint/user/profile-image/${authState.userId}',
),
radius: 18, radius: 18,
child: CircleAvatar(
backgroundColor: Theme.of(context).primaryColor.withOpacity(0.1),
backgroundImage: CachedNetworkImageProvider(
'$endpoint/user/profile-image/${authState.userId}',
),
radius: 17,
),
), ),
); );
} }
@@ -37,15 +37,19 @@ class ProfileDrawerHeader extends HookConsumerWidget {
if (uploadProfileImageStatus == UploadProfileStatus.idle) { if (uploadProfileImageStatus == UploadProfileStatus.idle) {
if (authState.profileImagePath.isNotEmpty) { if (authState.profileImagePath.isNotEmpty) {
return CircleAvatar( return CircleAvatar(
backgroundColor: Theme.of(context).primaryColor,
radius: 35, radius: 35,
backgroundImage: NetworkImage( child: CircleAvatar(
'$endpoint/user/profile-image/${authState.userId}?d=${dummy++}', radius: 34,
backgroundImage: NetworkImage(
'$endpoint/user/profile-image/${authState.userId}?d=${dummy++}',
),
backgroundColor: Colors.transparent,
), ),
backgroundColor: Colors.transparent,
); );
} else { } else {
return const CircleAvatar( return const CircleAvatar(
radius: 35, radius: 33,
backgroundImage: AssetImage('assets/immich-logo-no-outline.png'), backgroundImage: AssetImage('assets/immich-logo-no-outline.png'),
backgroundColor: Colors.transparent, backgroundColor: Colors.transparent,
); );
@@ -98,7 +102,7 @@ class ProfileDrawerHeader extends HookConsumerWidget {
useEffect( useEffect(
() { () {
buildUserProfileImage(); // buildUserProfileImage();
return null; return null;
}, },
[], [],
@@ -136,7 +140,7 @@ class ProfileDrawerHeader extends HookConsumerWidget {
child: GestureDetector( child: GestureDetector(
onTap: pickUserProfileImage, onTap: pickUserProfileImage,
child: Material( child: Material(
color: Colors.grey[100], color: isDarkMode ? Colors.grey[900] : Colors.grey[100],
elevation: 3, elevation: 3,
shape: RoundedRectangleBorder( shape: RoundedRectangleBorder(
borderRadius: BorderRadius.circular(50.0), borderRadius: BorderRadius.circular(50.0),