forked from Nexus/nexus
clean up account management settings
This commit is contained in:
parent
79d556a830
commit
6e3bc596fd
1 changed files with 15 additions and 18 deletions
|
|
@ -5,7 +5,6 @@ import "package:flutter_hooks/flutter_hooks.dart";
|
||||||
import "package:hooks_riverpod/hooks_riverpod.dart";
|
import "package:hooks_riverpod/hooks_riverpod.dart";
|
||||||
import "package:material_ui/material_ui.dart";
|
import "package:material_ui/material_ui.dart";
|
||||||
import "package:intl/intl.dart";
|
import "package:intl/intl.dart";
|
||||||
import "package:m3e_buttons/m3e_buttons.dart";
|
|
||||||
import "package:multi_state_switch/multi_state_switch.dart";
|
import "package:multi_state_switch/multi_state_switch.dart";
|
||||||
import "package:material_adaptive_sheets/material_adaptive_sheets.dart";
|
import "package:material_adaptive_sheets/material_adaptive_sheets.dart";
|
||||||
import "package:nexus/controllers/account_data.dart";
|
import "package:nexus/controllers/account_data.dart";
|
||||||
|
|
@ -70,18 +69,15 @@ class SettingsSectionsController
|
||||||
icon: icon,
|
icon: icon,
|
||||||
builder: (title, description, icon) => Builder(
|
builder: (title, description, icon) => Builder(
|
||||||
builder: (context) {
|
builder: (context) {
|
||||||
final colorScheme = Theme.of(context).colorScheme;
|
final error = Theme.of(context).colorScheme.error;
|
||||||
return M3EButton.icon(
|
return ListTile(
|
||||||
onPressed: () => ref.read(LaunchHelper.provider).launchUrl(url),
|
leading: Icon(icon),
|
||||||
label: Text(title),
|
title: Text(title),
|
||||||
icon: Icon(icon),
|
subtitle: Text(description),
|
||||||
tooltip: description,
|
trailing: Icon(Icons.open_in_new),
|
||||||
decoration: danger
|
textColor: danger ? error : null,
|
||||||
? .styleFrom(
|
iconColor: danger ? error : null,
|
||||||
backgroundColor: colorScheme.error,
|
onTap: () => ref.read(LaunchHelper.provider).launchUrl(url),
|
||||||
foregroundColor: colorScheme.onError,
|
|
||||||
)
|
|
||||||
: null,
|
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
),
|
),
|
||||||
|
|
@ -850,13 +846,14 @@ class SettingsSectionsController
|
||||||
title: "Reset Encryption Identity",
|
title: "Reset Encryption Identity",
|
||||||
description: "Replace your encryption identity and recovery key with new ones, if you've lost your recovery key or your encryption is broken.",
|
description: "Replace your encryption identity and recovery key with new ones, if you've lost your recovery key or your encryption is broken.",
|
||||||
builder: (title, description, icon) => Builder(
|
builder: (title, description, icon) => Builder(
|
||||||
builder: (context) => M3EButton.icon(
|
builder: (context) => ListTile(
|
||||||
onPressed: () => context.showAdaptiveSheet(
|
leading: Icon(icon),
|
||||||
|
title: Text(title),
|
||||||
|
subtitle: Text(description),
|
||||||
|
trailing: Icon(Icons.chevron_right),
|
||||||
|
onTap: () => context.showAdaptiveSheet(
|
||||||
(_) => const ResetEncryptionSheet(),
|
(_) => const ResetEncryptionSheet(),
|
||||||
),
|
),
|
||||||
label: Text(title),
|
|
||||||
icon: Icon(icon),
|
|
||||||
tooltip: description,
|
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
icon: Icons.key_off,
|
icon: Icons.key_off,
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue