fix: logo url dist null check

This commit is contained in:
lollipopkit🏳️‍⚧️
2025-04-08 14:49:26 +08:00
parent 95ca6bcfc9
commit e185414355

View File

@@ -161,11 +161,12 @@ class _ServerDetailPageState extends State<ServerDetailPage>
if (logoUrl == null) return UIs.placeholder;
final dist = si.status.more[StatusCmdType.sys]?.dist;
if (dist == null && (logoUrl.contains('{DIST}') || logoUrl.contains('{BRIGHT}')) ) return UIs.placeholder;
if (dist != null) {
logoUrl = logoUrl.replaceFirst('{DIST}', dist.name);
}
logoUrl =
logoUrl.replaceFirst('{BRIGHT}', context.isDark ? 'dark' : 'light');
logoUrl = logoUrl
.replaceFirst('{DIST}', dist.name)
.replaceFirst('{BRIGHT}', context.isDark ? 'dark' : 'light');
return Padding(
padding: const EdgeInsets.symmetric(vertical: 13),
child: ExtendedImage.network(