limit size of loading indicator for link previews

This commit is contained in:
Henry Hiles 2026-05-19 21:45:51 -04:00
commit 200ce2285c
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -12,14 +12,14 @@ class LinkPreview extends ConsumerWidget {
const LinkPreview(this.link, {super.key}); const LinkPreview(this.link, {super.key});
@override @override
Widget build(BuildContext context, WidgetRef ref) => ref Widget build(BuildContext context, WidgetRef ref) => ConstrainedBox(
constraints: BoxConstraints.loose(Size.fromWidth(400)),
child: ref
.watch(UrlPreviewController.provider(link)) .watch(UrlPreviewController.provider(link))
.betterWhen( .betterWhen(
data: (preview) => preview == null data: (preview) => preview == null
? SizedBox.shrink() ? SizedBox.shrink()
: ConstrainedBox( : InkWell(
constraints: BoxConstraints.loose(Size.fromWidth(400)),
child: InkWell(
onTap: () => ref onTap: () => ref
.watch(LaunchHelper.provider) .watch(LaunchHelper.provider)
.launchUrl(Uri.parse(link)), .launchUrl(Uri.parse(link)),