fix avatar fallback (#14458)

* fix avatar fallback

Signed-off-by: 21pages <sunboeasy@gmail.com>

* fix(ui): improve avatar fallback handling and layout consistency

  - Always show spacing in account section regardless of avatar presence
  - Handle null return from buildAvatarWidget with proper fallback
  - Adjust mobile settings avatar size to 28

Signed-off-by: 21pages <sunboeasy@gmail.com>

---------

Signed-off-by: 21pages <sunboeasy@gmail.com>
This commit is contained in:
21pages
2026-03-05 12:30:40 +08:00
committed by GitHub
parent ab64a32f30
commit 1abc897c45
4 changed files with 21 additions and 16 deletions

View File

@@ -857,16 +857,16 @@ class ClientInfo extends StatelessWidget {
Widget _buildAvatar(BuildContext context) {
final fallback = CircleAvatar(
backgroundColor: str2color(
client.name,
backgroundColor: str2color(client.name,
Theme.of(context).brightness == Brightness.light ? 255 : 150),
child: Text(client.name.isNotEmpty ? client.name[0] : '?'),
);
return buildAvatarWidget(
avatar: client.avatar,
size: 40,
fallback: fallback,
)!;
avatar: client.avatar,
size: 40,
fallback: fallback,
) ??
fallback;
}
}