fix: Crash in settings when using MAS
This commit is contained in:
parent
7a83927833
commit
99c49e3df2
3 changed files with 188 additions and 201 deletions
|
|
@ -199,14 +199,6 @@ class SettingsController extends State<Settings> {
|
|||
checkBootstrap();
|
||||
}
|
||||
|
||||
Future<String?> getOidcAccountManageUrl() async {
|
||||
final client = Matrix.of(context).client;
|
||||
final wellKnown = client.wellKnown ?? await client.getWellknown();
|
||||
return wellKnown.additionalProperties
|
||||
.tryGetMap<String, Object?>('org.matrix.msc2965.authentication')
|
||||
?.tryGet<String>('account');
|
||||
}
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
final client = Matrix.of(context).client;
|
||||
|
|
|
|||
|
|
@ -25,6 +25,12 @@ class SettingsView extends StatelessWidget {
|
|||
final showChatBackupBanner = controller.showChatBackupBanner;
|
||||
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)) ...[
|
||||
|
|
@ -52,11 +58,7 @@ class SettingsView extends StatelessWidget {
|
|||
),
|
||||
body: ListTileTheme(
|
||||
iconColor: theme.colorScheme.onSurface,
|
||||
child: FutureBuilder(
|
||||
future: controller.getOidcAccountManageUrl(),
|
||||
builder: (context, snapshot) {
|
||||
final accountManageUrl = snapshot.data;
|
||||
return ListView(
|
||||
child: ListView(
|
||||
key: const Key('SettingsListViewContent'),
|
||||
children: <Widget>[
|
||||
FutureBuilder<Profile>(
|
||||
|
|
@ -100,8 +102,7 @@ class SettingsView extends StatelessWidget {
|
|||
crossAxisAlignment: CrossAxisAlignment.start,
|
||||
children: [
|
||||
TextButton.icon(
|
||||
onPressed:
|
||||
controller.setDisplaynameAction,
|
||||
onPressed: controller.setDisplaynameAction,
|
||||
icon: const Icon(
|
||||
Icons.edit_outlined,
|
||||
size: 16,
|
||||
|
|
@ -177,8 +178,7 @@ class SettingsView extends StatelessWidget {
|
|||
ListTile(
|
||||
leading: const Icon(Icons.format_paint_outlined),
|
||||
title: Text(L10n.of(context).changeTheme),
|
||||
tileColor:
|
||||
activeRoute.startsWith('/rooms/settings/style')
|
||||
tileColor: activeRoute.startsWith('/rooms/settings/style')
|
||||
? theme.colorScheme.surfaceContainerHigh
|
||||
: null,
|
||||
onTap: () => context.go('/rooms/settings/style'),
|
||||
|
|
@ -186,19 +186,17 @@ class SettingsView extends StatelessWidget {
|
|||
ListTile(
|
||||
leading: const Icon(Icons.notifications_outlined),
|
||||
title: Text(L10n.of(context).notifications),
|
||||
tileColor: activeRoute
|
||||
.startsWith('/rooms/settings/notifications')
|
||||
tileColor:
|
||||
activeRoute.startsWith('/rooms/settings/notifications')
|
||||
? theme.colorScheme.surfaceContainerHigh
|
||||
: null,
|
||||
onTap: () =>
|
||||
context.go('/rooms/settings/notifications'),
|
||||
onTap: () => context.go('/rooms/settings/notifications'),
|
||||
),
|
||||
ListTile(
|
||||
leading: const Icon(Icons.devices_outlined),
|
||||
title: Text(L10n.of(context).devices),
|
||||
onTap: () => context.go('/rooms/settings/devices'),
|
||||
tileColor:
|
||||
activeRoute.startsWith('/rooms/settings/devices')
|
||||
tileColor: activeRoute.startsWith('/rooms/settings/devices')
|
||||
? theme.colorScheme.surfaceContainerHigh
|
||||
: null,
|
||||
),
|
||||
|
|
@ -206,8 +204,7 @@ class SettingsView extends StatelessWidget {
|
|||
leading: const Icon(Icons.forum_outlined),
|
||||
title: Text(L10n.of(context).chat),
|
||||
onTap: () => context.go('/rooms/settings/chat'),
|
||||
tileColor:
|
||||
activeRoute.startsWith('/rooms/settings/chat')
|
||||
tileColor: activeRoute.startsWith('/rooms/settings/chat')
|
||||
? theme.colorScheme.surfaceContainerHigh
|
||||
: null,
|
||||
),
|
||||
|
|
@ -252,8 +249,6 @@ class SettingsView extends StatelessWidget {
|
|||
onTap: controller.logoutAction,
|
||||
),
|
||||
],
|
||||
);
|
||||
},
|
||||
),
|
||||
),
|
||||
),
|
||||
|
|
|
|||
|
|
@ -35,7 +35,7 @@ class SettingsHomeserverView extends StatelessWidget {
|
|||
),
|
||||
),
|
||||
body: MaxWidthBody(
|
||||
withScrolling: false,
|
||||
withScrolling: true,
|
||||
child: SelectionArea(
|
||||
child: Column(
|
||||
mainAxisSize: MainAxisSize.min,
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue