refactor: update to matrix 6.0.0

This commit is contained in:
Christian Kußowski 2026-01-29 18:04:58 +01:00
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 { void removeDevicesAction(List<Device> devices) async {
final client = Matrix.of(context).client; 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') .tryGetMap<String, Object?>('org.matrix.msc2965.authentication')
?.tryGet<String>('account'); ?.tryGet<String>('account');
if (accountManageUrl != null) { if (accountManageUrl != null) {

View file

@ -28,12 +28,7 @@ class SettingsView extends StatelessWidget {
final activeRoute = GoRouter.of( final activeRoute = GoRouter.of(
context, context,
).routeInformationProvider.value.uri.path; ).routeInformationProvider.value.uri.path;
final accountManageUrl = Matrix.of(context)
.client
.wellKnown
?.additionalProperties
.tryGetMap<String, Object?>('org.matrix.msc2965.authentication')
?.tryGet<String>('account');
return Row( return Row(
children: [ children: [
if (FluffyThemes.isColumnMode(context)) ...[ if (FluffyThemes.isColumnMode(context)) ...[
@ -152,16 +147,30 @@ class SettingsView extends StatelessWidget {
); );
}, },
), ),
if (accountManageUrl != null) FutureBuilder(
ListTile( future: Matrix.of(context).client.getWellknown(),
leading: const Icon(Icons.account_circle_outlined), builder: (context, snapshot) {
title: Text(L10n.of(context).manageAccount), final accountManageUrl = snapshot
trailing: const Icon(Icons.open_in_new_outlined), .data
onTap: () => launchUrlString( ?.additionalProperties
accountManageUrl, .tryGetMap<String, Object?>(
mode: LaunchMode.inAppBrowserView, '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), Divider(color: theme.dividerColor),
if (showChatBackupBanner == null) if (showChatBackupBanner == null)
ListTile( ListTile(

View file

@ -178,7 +178,6 @@ class SettingsHomeserverView extends StatelessWidget {
Divider(color: theme.dividerColor), Divider(color: theme.dividerColor),
FutureBuilder( FutureBuilder(
future: client.getWellknown(), future: client.getWellknown(),
initialData: client.wellKnown,
builder: (context, snapshot) { builder: (context, snapshot) {
final error = snapshot.error; final error = snapshot.error;
if (error != null) { if (error != null) {

View file

@ -1088,10 +1088,10 @@ packages:
dependency: "direct main" dependency: "direct main"
description: description:
name: matrix name: matrix
sha256: "8cf9f502bf67e996b0503c8597c3b789c955f8b2331ecd4433658c732dc2c13f" sha256: f1c0cc366a8cd0b9aec6b57f81203c4d9aa9f92793f7ac12ae50410648b070e4
url: "https://pub.dev" url: "https://pub.dev"
source: hosted source: hosted
version: "5.0.0" version: "6.0.0"
meta: meta:
dependency: transitive dependency: transitive
description: description:

View file

@ -53,7 +53,7 @@ dependencies:
just_audio: ^0.10.5 just_audio: ^0.10.5
latlong2: ^0.9.1 latlong2: ^0.9.1
linkify: ^5.0.0 linkify: ^5.0.0
matrix: ^5.0.0 matrix: ^6.0.0
mime: ^2.0.0 mime: ^2.0.0
opus_caf_converter_dart: ^1.0.1 opus_caf_converter_dart: ^1.0.1
package_info_plus: ^8.3.1 package_info_plus: ^8.3.1