From f31887b6d2696f486cff8c673ddfab6046b61b29 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Christian=20Ku=C3=9Fowski?= Date: Thu, 29 Jan 2026 18:04:58 +0100 Subject: [PATCH] refactor: update to matrix 6.0.0 --- .../device_settings/device_settings.dart | 3 +- lib/pages/settings/settings_view.dart | 41 +++++++++++-------- .../settings_homeserver_view.dart | 1 - pubspec.lock | 4 +- pubspec.yaml | 2 +- 5 files changed, 30 insertions(+), 21 deletions(-) diff --git a/lib/pages/device_settings/device_settings.dart b/lib/pages/device_settings/device_settings.dart index 12c1d1fce..dc655ab8f 100644 --- a/lib/pages/device_settings/device_settings.dart +++ b/lib/pages/device_settings/device_settings.dart @@ -55,7 +55,8 @@ class DevicesSettingsController extends State { void removeDevicesAction(List devices) async { final client = Matrix.of(context).client; - final accountManageUrl = client.wellKnown?.additionalProperties + final wellKnown = await client.getWellknown(); + final accountManageUrl = wellKnown.additionalProperties .tryGetMap('org.matrix.msc2965.authentication') ?.tryGet('account'); if (accountManageUrl != null) { diff --git a/lib/pages/settings/settings_view.dart b/lib/pages/settings/settings_view.dart index 12d70db59..419db1ced 100644 --- a/lib/pages/settings/settings_view.dart +++ b/lib/pages/settings/settings_view.dart @@ -28,12 +28,7 @@ class SettingsView extends StatelessWidget { final activeRoute = GoRouter.of( context, ).routeInformationProvider.value.uri.path; - final accountManageUrl = Matrix.of(context) - .client - .wellKnown - ?.additionalProperties - .tryGetMap('org.matrix.msc2965.authentication') - ?.tryGet('account'); + return Row( children: [ if (FluffyThemes.isColumnMode(context)) ...[ @@ -152,16 +147,30 @@ class SettingsView extends StatelessWidget { ); }, ), - if (accountManageUrl != null) - ListTile( - leading: const Icon(Icons.account_circle_outlined), - title: Text(L10n.of(context).manageAccount), - trailing: const Icon(Icons.open_in_new_outlined), - onTap: () => launchUrlString( - accountManageUrl, - mode: LaunchMode.inAppBrowserView, - ), - ), + FutureBuilder( + future: Matrix.of(context).client.getWellknown(), + builder: (context, snapshot) { + final accountManageUrl = snapshot + .data + ?.additionalProperties + .tryGetMap( + 'org.matrix.msc2965.authentication', + ) + ?.tryGet('account'); + if (accountManageUrl == null) { + return const SizedBox.shrink(); + } + return ListTile( + leading: const Icon(Icons.account_circle_outlined), + title: Text(L10n.of(context).manageAccount), + trailing: const Icon(Icons.open_in_new_outlined), + onTap: () => launchUrlString( + accountManageUrl, + mode: LaunchMode.inAppBrowserView, + ), + ); + }, + ), Divider(color: theme.dividerColor), if (showChatBackupBanner == null) ListTile( diff --git a/lib/pages/settings_homeserver/settings_homeserver_view.dart b/lib/pages/settings_homeserver/settings_homeserver_view.dart index 678ff6c31..195c1701e 100644 --- a/lib/pages/settings_homeserver/settings_homeserver_view.dart +++ b/lib/pages/settings_homeserver/settings_homeserver_view.dart @@ -178,7 +178,6 @@ class SettingsHomeserverView extends StatelessWidget { Divider(color: theme.dividerColor), FutureBuilder( future: client.getWellknown(), - initialData: client.wellKnown, builder: (context, snapshot) { final error = snapshot.error; if (error != null) { diff --git a/pubspec.lock b/pubspec.lock index 1748f3c72..3bd269256 100644 --- a/pubspec.lock +++ b/pubspec.lock @@ -1088,10 +1088,10 @@ packages: dependency: "direct main" description: name: matrix - sha256: "8cf9f502bf67e996b0503c8597c3b789c955f8b2331ecd4433658c732dc2c13f" + sha256: f1c0cc366a8cd0b9aec6b57f81203c4d9aa9f92793f7ac12ae50410648b070e4 url: "https://pub.dev" source: hosted - version: "5.0.0" + version: "6.0.0" meta: dependency: transitive description: diff --git a/pubspec.yaml b/pubspec.yaml index d416aaff8..34d18102f 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -53,7 +53,7 @@ dependencies: just_audio: ^0.10.5 latlong2: ^0.9.1 linkify: ^5.0.0 - matrix: ^5.0.0 + matrix: ^6.0.0 mime: ^2.0.0 opus_caf_converter_dart: ^1.0.1 package_info_plus: ^8.3.1