refactor: update to matrix 6.0.0

This commit is contained in:
Christian Kußowski 2026-01-29 18:04:58 +01:00
parent fa27ab2141
commit f31887b6d2
No known key found for this signature in database
GPG key ID: E067ECD60F1A0652
5 changed files with 30 additions and 21 deletions

View file

@ -55,7 +55,8 @@ class DevicesSettingsController extends State<DevicesSettings> {
void removeDevicesAction(List<Device> devices) async {
final client = Matrix.of(context).client;
final accountManageUrl = client.wellKnown?.additionalProperties
final wellKnown = await client.getWellknown();
final accountManageUrl = wellKnown.additionalProperties
.tryGetMap<String, Object?>('org.matrix.msc2965.authentication')
?.tryGet<String>('account');
if (accountManageUrl != null) {

View file

@ -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<String, Object?>('org.matrix.msc2965.authentication')
?.tryGet<String>('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<String, Object?>(
'org.matrix.msc2965.authentication',
)
?.tryGet<String>('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(

View file

@ -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) {

View file

@ -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:

View file

@ -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