diff --git a/lib/ui/party_room/widgets/party_room_list_page.dart b/lib/ui/party_room/widgets/party_room_list_page.dart index f1f64f9..95e1a00 100644 --- a/lib/ui/party_room/widgets/party_room_list_page.dart +++ b/lib/ui/party_room/widgets/party_room_list_page.dart @@ -370,12 +370,11 @@ class PartyRoomListPage extends HookConsumerWidget { ], ), const SizedBox(height: 12), - // 标签和时间 Row( children: [ makeTagContainer(partyRoom, room), if (room.socialLinks.isNotEmpty) ...[ - const SizedBox(width: 6), + const SizedBox(width: 12), Container( padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 4), decoration: BoxDecoration( @@ -386,11 +385,6 @@ class PartyRoomListPage extends HookConsumerWidget { mainAxisSize: MainAxisSize.min, children: [ Icon(FluentIcons.link, size: 10, color: Colors.green.withValues(alpha: 0.8)), - const SizedBox(width: 4), - Text( - '${room.socialLinks.length}', - style: TextStyle(fontSize: 11, color: Colors.green.withValues(alpha: 0.9)), - ), ], ), ), diff --git a/lib/widgets/src/cache_svg_image.dart b/lib/widgets/src/cache_svg_image.dart index 0e4148c..bce682e 100644 --- a/lib/widgets/src/cache_svg_image.dart +++ b/lib/widgets/src/cache_svg_image.dart @@ -18,47 +18,35 @@ class CachedSvgImage extends HookWidget { final cachedFile = useState(null); final errorInfo = useState(null); - useEffect( - () { - () async { - try { - cachedFile.value = await FileCacheUtils.getFile(url); - } catch (e) { - debugPrint("Error loading SVG: $e"); - errorInfo.value = "Error loading SVG: $e"; - } - }(); - return null; - }, - [url], - ); + useEffect(() { + () async { + try { + final file = await FileCacheUtils.getFile(url); + if (context.mounted) cachedFile.value = file; + } catch (e) { + debugPrint("Error loading SVG: $e"); + if (context.mounted) errorInfo.value = "Error loading SVG: $e"; + } + }(); + return null; + }, [url]); if (errorInfo.value != null) { return SizedBox( width: width, height: height, child: Center( - child: Text( - errorInfo.value!, - style: TextStyle(color: Colors.red), - ), + child: Text(errorInfo.value!, style: TextStyle(color: Colors.red)), ), ); } return cachedFile.value != null - ? SvgPicture.file( - cachedFile.value!, - width: width, - height: height, - fit: fit ?? BoxFit.contain, - ) + ? SvgPicture.file(cachedFile.value!, width: width, height: height, fit: fit ?? BoxFit.contain) : SizedBox( width: width, height: height, - child: Center( - child: ProgressRing(), - ), + child: Center(child: ProgressRing()), ); } }