🎨 Optimize the null check in list

This commit is contained in:
2026-02-02 15:48:48 +08:00
parent cfd2a47064
commit 583902ad52
5 changed files with 366 additions and 422 deletions

View File

@@ -478,10 +478,7 @@ class PostItem extends HookConsumerWidget {
final translationSection = Column(
crossAxisAlignment: CrossAxisAlignment.stretch,
children: [
if (translatedWidget != null) translatedWidget,
if (translatableWidget != null) translatableWidget,
],
children: [?translatedWidget, ?translatableWidget],
);
return Column(

View File

@@ -854,7 +854,7 @@ class PostHeader extends HookConsumerWidget {
],
),
),
if (trailing != null) trailing!,
?trailing,
],
),
],
@@ -1142,7 +1142,7 @@ class PostBody extends ConsumerWidget {
attachments: item.attachments,
noMentionChip: item.fediverseUri != null,
),
if (translationSection != null) translationSection!,
?translationSection,
],
),
),