mirror of
https://github.com/rustdesk/rustdesk.git
synced 2026-04-04 12:01:28 +03:00
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:
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user