♻️ Better image loading animation and more commonly used blurhash

This commit is contained in:
2026-01-02 18:32:37 +08:00
parent f1f5113b01
commit 78c1a284a5
44 changed files with 2043 additions and 2185 deletions

View File

@@ -178,7 +178,7 @@ class EditChatScreen extends HookConsumerWidget {
bottom: -32,
child: GestureDetector(
child: ProfilePictureWidget(
fileId: picture.value?.id,
file: picture.value,
radius: 40,
fallbackIcon: Symbols.group,
),

View File

@@ -98,15 +98,15 @@ class PublicRoomPreview extends HookConsumerWidget {
SizedBox(
height: 26,
width: 26,
child: (room.type == 1 && room.picture?.id == null)
child: (room.type == 1 && room.picture == null)
? SplitAvatarWidget(
filesId: room.members!
.map((e) => e.account.profile.picture?.id)
files: room.members!
.map((e) => e.account.profile.picture)
.toList(),
)
: room.picture?.id != null
: room.picture != null
? ProfilePictureWidget(
fileId: room.picture?.id,
file: room.picture,
fallbackIcon: Symbols.chat,
)
: CircleAvatar(
@@ -131,15 +131,15 @@ class PublicRoomPreview extends HookConsumerWidget {
SizedBox(
height: 26,
width: 26,
child: (room.type == 1 && room.picture?.id == null)
child: (room.type == 1 && room.picture == null)
? SplitAvatarWidget(
filesId: room.members!
.map((e) => e.account.profile.picture?.id)
files: room.members!
.map((e) => e.account.profile.picture)
.toList(),
)
: room.picture?.id != null
: room.picture != null
? ProfilePictureWidget(
fileId: room.picture?.id,
file: room.picture,
fallbackIcon: Symbols.chat,
)
: CircleAvatar(

View File

@@ -427,15 +427,15 @@ class ChatRoomScreen extends HookConsumerWidget {
child: SizedBox(
height: 26,
width: 26,
child: (room!.type == 1 && room.picture?.id == null)
child: (room!.type == 1 && room.picture == null)
? SplitAvatarWidget(
filesId: getValidMembers(
files: getValidMembers(
room.members!,
).map((e) => e.account.profile.picture?.id).toList(),
).map((e) => e.account.profile.picture).toList(),
)
: room.picture?.id != null
: room.picture != null
? ProfilePictureWidget(
fileId: room.picture?.id,
file: room.picture,
fallbackIcon: Symbols.chat,
)
: CircleAvatar(
@@ -473,15 +473,15 @@ class ChatRoomScreen extends HookConsumerWidget {
child: SizedBox(
height: 28,
width: 28,
child: (room!.type == 1 && room.picture?.id == null)
child: (room!.type == 1 && room.picture == null)
? SplitAvatarWidget(
filesId: getValidMembers(
files: getValidMembers(
room.members!,
).map((e) => e.account.profile.picture?.id).toList(),
).map((e) => e.account.profile.picture).toList(),
)
: room.picture?.id != null
: room.picture != null
? ProfilePictureWidget(
fileId: room.picture?.id,
file: room.picture,
fallbackIcon: Symbols.chat,
)
: CircleAvatar(

View File

@@ -279,9 +279,8 @@ class ChatDetailScreen extends HookConsumerWidget {
leading: PageBackButton(shadows: [iconShadow]),
flexibleSpace: FlexibleSpaceBar(
background:
(currentRoom!.type == 1 &&
currentRoom.background?.id != null)
? CloudImageWidget(fileId: currentRoom.background!.id)
(currentRoom!.type == 1 && currentRoom.background != null)
? CloudImageWidget(file: currentRoom.background!)
: (currentRoom.type == 1 &&
currentRoom.members!.length == 1 &&
currentRoom
@@ -293,17 +292,16 @@ class ChatDetailScreen extends HookConsumerWidget {
?.id !=
null)
? CloudImageWidget(
fileId: currentRoom
file: currentRoom
.members!
.first
.account
.profile
.background!
.id,
.background!,
)
: currentRoom.background?.id != null
: currentRoom.background != null
? CloudImageWidget(
fileId: currentRoom.background!.id,
file: currentRoom.background!,
fit: BoxFit.cover,
)
: Container(
@@ -702,7 +700,7 @@ class _ChatMemberListSheet extends HookConsumerWidget {
leading: AccountPfcGestureDetector(
uname: member.account.name,
child: ProfilePictureWidget(
fileId: member.account.profile.picture?.id,
file: member.account.profile.picture,
),
),
title: Row(