put bridge for link colors

This commit is contained in:
Henry Hiles 2026-08-22 15:14:41 -04:00
commit 0887421f3e
Signed by: Henry-Hiles
SSH key fingerprint: SHA256:VKQUdS31Q90KvX7EkKMHMBpUspcmItAh86a+v7PGiIs

View file

@ -18,7 +18,9 @@ class const Html(
super.key, super.key,
}) extends ConsumerWidget { }) extends ConsumerWidget {
@override @override
Widget build(BuildContext context, WidgetRef ref) => HtmlWidget( Widget build(BuildContext context, WidgetRef ref) =>
MaterialUiCompatibilityBridge(
child: HtmlWidget(
html, html,
buildAsync: false, buildAsync: false,
textStyle: textStyle, textStyle: textStyle,
@ -33,7 +35,9 @@ class const Html(
final height = final height =
int.tryParse(element.attributes["height"] ?? "") ?? int.tryParse(element.attributes["height"] ?? "") ??
(element.attributes.keys.contains("data-mx-emoticon") ? 32 : null) ?? (element.attributes.keys.contains("data-mx-emoticon")
? 32
: null) ??
300; 300;
final width = int.tryParse(element.attributes["width"] ?? ""); final width = int.tryParse(element.attributes["width"] ?? "");
final src = Uri.tryParse(element.attributes["src"] ?? ""); final src = Uri.tryParse(element.attributes["src"] ?? "");
@ -69,7 +73,9 @@ class const Html(
image: MxcImage(ref, .new(mxc: src)), image: MxcImage(ref, .new(mxc: src)),
errorBuilder: (_, error, _) => Text( errorBuilder: (_, error, _) => Text(
"Image Failed to Load", "Image Failed to Load",
style: .new(color: Theme.of(context).colorScheme.error), style: .new(
color: Theme.of(context).colorScheme.error,
),
), ),
height: height.toDouble(), height: height.toDouble(),
width: width?.toDouble(), width: width?.toDouble(),
@ -135,6 +141,8 @@ class const Html(
.nonNulls, .nonNulls,
), ),
}, },
onTapUrl: (url) => ref.watch(LaunchHelper.provider).launchUrl(.parse(url)), onTapUrl: (url) =>
ref.watch(LaunchHelper.provider).launchUrl(.parse(url)),
),
); );
} }