chore: Readd support for html tables

This commit is contained in:
Krille 2023-05-19 17:30:25 +02:00
parent b62c41ce57
commit f53d17eab7
No known key found for this signature in database
4 changed files with 41 additions and 0 deletions

View File

@ -291,6 +291,7 @@
files = ( files = (
); );
inputPaths = ( inputPaths = (
"${TARGET_BUILD_DIR}/${INFOPLIST_PATH}",
); );
name = "Thin Binary"; name = "Thin Binary";
outputPaths = ( outputPaths = (

View File

@ -4,6 +4,7 @@ import 'package:collection/collection.dart';
import 'package:flutter_highlighter/flutter_highlighter.dart'; import 'package:flutter_highlighter/flutter_highlighter.dart';
import 'package:flutter_highlighter/themes/shades-of-purple.dart'; import 'package:flutter_highlighter/themes/shades-of-purple.dart';
import 'package:flutter_html/flutter_html.dart'; import 'package:flutter_html/flutter_html.dart';
import 'package:flutter_html_table/flutter_html_table.dart';
import 'package:flutter_math_fork/flutter_math.dart'; import 'package:flutter_math_fork/flutter_math.dart';
import 'package:matrix/matrix.dart'; import 'package:matrix/matrix.dart';
@ -91,6 +92,19 @@ class HtmlMessage extends StatelessWidget {
'hr': Style( 'hr': Style(
border: Border.all(color: textColor, width: 0.5), border: Border.all(color: textColor, width: 0.5),
), ),
'table': Style(
border: Border.all(color: textColor, width: 0.5),
),
'tr': Style(
border: Border.all(color: textColor, width: 0.5),
),
'td': Style(
border: Border.all(color: textColor, width: 0.5),
padding: const EdgeInsets.all(2),
),
'th': Style(
border: Border.all(color: textColor, width: 0.5),
),
}, },
extensions: [ extensions: [
UserPillExtension(context, room), UserPillExtension(context, room),
@ -99,6 +113,7 @@ class HtmlMessage extends StatelessWidget {
MatrixMathExtension( MatrixMathExtension(
style: TextStyle(fontSize: fontSize, color: textColor), style: TextStyle(fontSize: fontSize, color: textColor),
), ),
const TableHtmlExtension(),
], ],
onLinkTap: (url, _, __) => UrlLauncher(context, url).launchUrl(), onLinkTap: (url, _, __) => UrlLauncher(context, url).launchUrl(),
onlyRenderTheseTags: const { onlyRenderTheseTags: const {

View File

@ -459,6 +459,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "3.0.0-beta.1" version: "3.0.0-beta.1"
flutter_html_table:
dependency: "direct main"
description:
name: flutter_html_table
sha256: "0fd718e55dcd280c25b18beb01c491147525e7bebe73d6973b9a7bde9c4dcc9a"
url: "https://pub.dev"
source: hosted
version: "3.0.0-beta.1"
flutter_keyboard_visibility: flutter_keyboard_visibility:
dependency: transitive dependency: transitive
description: description:
@ -507,6 +515,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "1.0.0" version: "1.0.0"
flutter_layout_grid:
dependency: transitive
description:
name: flutter_layout_grid
sha256: "31728ce6e9c8eaa48f8a3f928a7c308da4b74ab867aec2dc5b80b0c9f9b79d0d"
url: "https://pub.dev"
source: hosted
version: "2.0.3"
flutter_linkify: flutter_linkify:
dependency: "direct main" dependency: "direct main"
description: description:
@ -1406,6 +1422,14 @@ packages:
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "4.0.0" version: "4.0.0"
quiver:
dependency: transitive
description:
name: quiver
sha256: b1c1ac5ce6688d77f65f3375a9abb9319b3cb32486bdc7a1e0fdf004d7ba4e47
url: "https://pub.dev"
source: hosted
version: "3.2.1"
random_string: random_string:
dependency: transitive dependency: transitive
description: description:

View File

@ -35,6 +35,7 @@ dependencies:
flutter_foreground_task: ^3.10.0 flutter_foreground_task: ^3.10.0
flutter_highlighter: ^0.1.1 flutter_highlighter: ^0.1.1
flutter_html: ^3.0.0-beta.1 flutter_html: ^3.0.0-beta.1
flutter_html_table: ^3.0.0-beta.1
flutter_linkify: ^6.0.0 flutter_linkify: ^6.0.0
flutter_local_notifications: ^12.0.2 flutter_local_notifications: ^12.0.2
flutter_localizations: flutter_localizations: