diff --git a/lib/components/html_message.dart b/lib/components/html_message.dart
index df508a41e..a67377a06 100644
--- a/lib/components/html_message.dart
+++ b/lib/components/html_message.dart
@@ -33,6 +33,8 @@ class HtmlMessage extends StatelessWidget {
// there is no need to pre-validate the html, as we validate it while rendering
+ final matrix = Matrix.of(context);
+
final themeData = Theme.of(context);
return Html(
data: renderHtml,
@@ -50,12 +52,18 @@ class HtmlMessage extends StatelessWidget {
getMxcUrl: (String mxc, double width, double height) {
final ratio = MediaQuery.of(context).devicePixelRatio;
return Uri.parse(mxc)?.getThumbnail(
- Matrix.of(context).client,
+ matrix.client,
width: (width ?? 800) * ratio,
height: (height ?? 800) * ratio,
method: ThumbnailMethod.scale,
);
},
+ setCodeLanguage: (String key, String value) async {
+ await matrix.store.setItem('code_language.$key', value);
+ },
+ getCodeLanguage: (String key) async {
+ return await matrix.store.getItem('code_language.$key');
+ },
getPillInfo: (String identifier) async {
if (room == null) {
return null;
diff --git a/lib/utils/famedlysdk_store.dart b/lib/utils/famedlysdk_store.dart
index 6bb3f9cb5..34232e59c 100644
--- a/lib/utils/famedlysdk_store.dart
+++ b/lib/utils/famedlysdk_store.dart
@@ -62,7 +62,7 @@ class Store {
if (!PlatformInfos.isMobile) {
await _setupLocalStorage();
try {
- return await storage.getItem(key).toString();
+ return await storage.getItem(key)?.toString();
} catch (_) {
return null;
}
diff --git a/pubspec.lock b/pubspec.lock
index 7a1d4823e..849b91621 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -309,6 +309,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "2.0.0"
+ flutter_highlight:
+ dependency: transitive
+ description:
+ name: flutter_highlight
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.0"
flutter_keyboard_visibility:
dependency: transitive
description:
@@ -348,7 +355,7 @@ packages:
name: flutter_matrix_html
url: "https://pub.dartlang.org"
source: hosted
- version: "0.1.9"
+ version: "0.1.10"
flutter_olm:
dependency: "direct main"
description:
@@ -408,6 +415,13 @@ packages:
url: "https://pub.dartlang.org"
source: hosted
version: "1.2.0"
+ highlight:
+ dependency: transitive
+ description:
+ name: highlight
+ url: "https://pub.dartlang.org"
+ source: hosted
+ version: "0.6.0"
html:
dependency: transitive
description:
@@ -540,7 +554,7 @@ packages:
name: matrix_link_text
url: "https://pub.dartlang.org"
source: hosted
- version: "0.3.1"
+ version: "0.3.2"
meta:
dependency: transitive
description:
diff --git a/pubspec.yaml b/pubspec.yaml
index 1aa8c199b..0aa8704ea 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -37,7 +37,7 @@ dependencies:
firebase_messaging: ^7.0.2
flutter_local_notifications: ^1.4.3
# desktop_notifications: ^0.0.0-dev.4 // Currently blocked by: https://github.com/canonical/desktop_notifications.dart/issues/5
- matrix_link_text: ^0.3.1
+ matrix_link_text: ^0.3.2
path_provider: ^1.5.1
downloads_path_provider_28: ^0.1.0
permission_handler: ^5.0.1+1
@@ -53,7 +53,7 @@ dependencies:
open_file: ^3.0.1
mime_type: ^0.3.0
bot_toast: ^3.0.0
- flutter_matrix_html: ^0.1.9
+ flutter_matrix_html: ^0.1.10
moor: ^3.3.1
sqlite3_flutter_libs: ^0.2.0
sqlite3: ^0.1.4