put bridge for link colors
This commit is contained in:
parent
a090d88a23
commit
0887421f3e
1 changed files with 118 additions and 110 deletions
|
|
@ -18,7 +18,9 @@ class const Html(
|
|||
super.key,
|
||||
}) extends ConsumerWidget {
|
||||
@override
|
||||
Widget build(BuildContext context, WidgetRef ref) => HtmlWidget(
|
||||
Widget build(BuildContext context, WidgetRef ref) =>
|
||||
MaterialUiCompatibilityBridge(
|
||||
child: HtmlWidget(
|
||||
html,
|
||||
buildAsync: false,
|
||||
textStyle: textStyle,
|
||||
|
|
@ -33,7 +35,9 @@ class const Html(
|
|||
|
||||
final 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;
|
||||
final width = int.tryParse(element.attributes["width"] ?? "");
|
||||
final src = Uri.tryParse(element.attributes["src"] ?? "");
|
||||
|
|
@ -69,7 +73,9 @@ class const Html(
|
|||
image: MxcImage(ref, .new(mxc: src)),
|
||||
errorBuilder: (_, error, _) => Text(
|
||||
"Image Failed to Load",
|
||||
style: .new(color: Theme.of(context).colorScheme.error),
|
||||
style: .new(
|
||||
color: Theme.of(context).colorScheme.error,
|
||||
),
|
||||
),
|
||||
height: height.toDouble(),
|
||||
width: width?.toDouble(),
|
||||
|
|
@ -135,6 +141,8 @@ class const Html(
|
|||
.nonNulls,
|
||||
),
|
||||
},
|
||||
onTapUrl: (url) => ref.watch(LaunchHelper.provider).launchUrl(.parse(url)),
|
||||
onTapUrl: (url) =>
|
||||
ref.watch(LaunchHelper.provider).launchUrl(.parse(url)),
|
||||
),
|
||||
);
|
||||
}
|
||||
|
|
|
|||
Loading…
Reference in a new issue