Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -100,7 +100,7 @@ Future<ThunderPost> parsePost(ThunderPost post, bool fetchImageDimensions, bool

// Set the proper alt text for the media
if (media.mediaType == MediaType.text) {
media.altText = post.body;
media.altText = post.body ?? post.name;
} else if (media.mediaType == MediaType.image) {
media.altText = post.altText;
}
Expand Down
27 changes: 20 additions & 7 deletions lib/src/shared/content/widgets/media/media_view_text.dart
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
import 'package:flutter/material.dart';

import 'package:thunder/src/foundation/primitives/primitives.dart';

class MediaViewText extends StatelessWidget {
const MediaViewText({
super.key,
Expand All @@ -17,13 +19,24 @@ class MediaViewText extends StatelessWidget {
alpha: read == true ? 0.55 : 1.0,
);

return Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
text ?? '',
maxLines: 4,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyMedium?.copyWith(color: foreground),
return Container(
clipBehavior: Clip.hardEdge,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12.0),
color: theme.colorScheme.surfaceContainerHighest.withValues(
alpha: read == true ? 0.55 : 1.0,
),
),
height: ViewMode.compact.height,
width: ViewMode.compact.height,
child: Padding(
padding: const EdgeInsets.all(12.0),
child: Text(
text ?? '',
maxLines: 4,
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyMedium?.copyWith(color: foreground, fontSize: 8.0),
),
),
);
}
Expand Down
Loading