refactor: Reimplement flutter matrix html locally

This commit is contained in:
Krille 2023-05-17 12:26:59 +02:00
commit 796a6fdae1
9 changed files with 431 additions and 291 deletions

View file

@ -1,8 +1,8 @@
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
import 'package:flutter_linkify/flutter_linkify.dart';
import 'package:matrix/matrix.dart';
import 'package:matrix_link_text/link_text.dart';
import 'package:vrouter/vrouter.dart';
import 'package:fluffychat/config/app_config.dart';
@ -125,13 +125,13 @@ class ChatDetailsView extends StatelessWidget {
padding: const EdgeInsets.symmetric(
horizontal: 16.0,
),
child: LinkText(
child: Linkify(
text: room.topic.isEmpty
? L10n.of(context)!.addGroupDescription
: room.topic,
linkStyle:
const TextStyle(color: Colors.blueAccent),
textStyle: TextStyle(
style: TextStyle(
fontSize: 14,
color: Theme.of(context)
.textTheme
@ -142,11 +142,8 @@ class ChatDetailsView extends StatelessWidget {
.bodyMedium!
.color,
),
beforeLaunch: (url) {
UrlLauncher(context, url.toString())
.launchUrl();
return false;
},
onOpen: (url) =>
UrlLauncher(context, url.url).launchUrl(),
),
),
const SizedBox(height: 8),