From 2073bf9f6d99714812485859ed871000b7c730a4 Mon Sep 17 00:00:00 2001 From: Kelrap Date: Tue, 10 Jun 2025 10:13:02 -0400 Subject: [PATCH] Add default space description to public space cards when no topic has been set --- .../public_room_bottom_sheet.dart | 18 +++++++++--------- .../public_spaces/public_space_card.dart | 18 +++++++++--------- 2 files changed, 18 insertions(+), 18 deletions(-) diff --git a/lib/pangea/public_spaces/public_room_bottom_sheet.dart b/lib/pangea/public_spaces/public_room_bottom_sheet.dart index 07b29095d..2dfb27fc8 100644 --- a/lib/pangea/public_spaces/public_room_bottom_sheet.dart +++ b/lib/pangea/public_spaces/public_room_bottom_sheet.dart @@ -221,17 +221,17 @@ class PublicRoomBottomSheetState extends State { ), ], ), - if (chunk?.topic != null) - Flexible( - child: SingleChildScrollView( - child: Text( - chunk!.topic!, - softWrap: true, - textAlign: TextAlign.start, - maxLines: null, - ), + Flexible( + child: SingleChildScrollView( + child: Text( + chunk?.topic ?? + L10n.of(context).noSpaceDescriptionYet, + softWrap: true, + textAlign: TextAlign.start, + maxLines: null, ), ), + ), ], ), ), diff --git a/lib/pangea/public_spaces/public_space_card.dart b/lib/pangea/public_spaces/public_space_card.dart index 8d1c58ddf..03169f9ef 100644 --- a/lib/pangea/public_spaces/public_space_card.dart +++ b/lib/pangea/public_spaces/public_space_card.dart @@ -123,16 +123,16 @@ class PublicSpaceCard extends StatelessWidget { ), ], ), - if (space.topic != null) - Flexible( - child: Text( - space.topic!, - style: theme.textTheme.bodySmall, - overflow: TextOverflow.ellipsis, - textAlign: TextAlign.start, - maxLines: 5, - ), + Flexible( + child: Text( + space.topic ?? + L10n.of(context).noSpaceDescriptionYet, + style: theme.textTheme.bodySmall, + overflow: TextOverflow.ellipsis, + textAlign: TextAlign.start, + maxLines: 5, ), + ), ], ), ),