Skip to content

Commit

Permalink
Fix post page failure when image fails to load (#1132)
Browse files Browse the repository at this point in the history
  • Loading branch information
hjiangsu authored Feb 17, 2024
1 parent 1102994 commit c3b31f3
Showing 1 changed file with 22 additions and 35 deletions.
57 changes: 22 additions & 35 deletions lib/shared/media_view.dart
Original file line number Diff line number Diff line change
Expand Up @@ -253,47 +253,34 @@ class _MediaViewState extends State<MediaView> with SingleTickerProviderStateMix
state.imageProvider.evict();

return Container(
color: theme.cardColor.darken(3),
child: Padding(
padding: const EdgeInsets.only(top: 4.0, bottom: 8.0),
child: Material(
clipBehavior: Clip.hardEdge,
borderRadius: BorderRadius.circular(12),
child: Stack(
alignment: Alignment.bottomRight,
fit: StackFit.passthrough,
decoration: BoxDecoration(
borderRadius: BorderRadius.circular(12),
color: theme.colorScheme.secondary.withOpacity(0.4),
),
child: InkWell(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
child: Row(
children: [
Container(
color: theme.colorScheme.secondary.withOpacity(0.4),
padding: const EdgeInsets.symmetric(horizontal: 8.0, vertical: 12.0),
child: Row(
children: [
const Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Icon(
Icons.link,
),
),
Expanded(
child: Text(
widget.post?.url ?? '',
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyMedium,
),
),
],
),
const Padding(
padding: EdgeInsets.symmetric(horizontal: 8.0),
child: Icon(Icons.link),
),
InkWell(
onTap: () {
if (widget.post?.url != null) {
handleLink(context, url: widget.post!.url!);
}
},
Expanded(
child: Text(
widget.post?.url ?? '',
overflow: TextOverflow.ellipsis,
style: theme.textTheme.bodyMedium,
),
),
],
),
),
onTap: () {
if (widget.post?.url != null) {
handleLink(context, url: widget.post!.url!);
}
},
),
);
}
Expand Down

0 comments on commit c3b31f3

Please sign in to comment.