chore: Follow up settings page

This commit is contained in:
Krille 2023-02-04 21:59:53 +01:00
parent 72767f0716
commit 50dc19b0de
2 changed files with 15 additions and 4 deletions

View File

@ -179,6 +179,15 @@ class SettingsController extends State<Settings> {
bool? showChatBackupBanner;
void firstRunBootstrapAction([_]) async {
if (showChatBackupBanner != true) {
showOkAlertDialog(
context: context,
title: L10n.of(context)!.chatBackup,
message: L10n.of(context)!.onlineKeyBackupEnabled,
okLabel: L10n.of(context)!.close,
);
return;
}
await BootstrapDialog(
client: Matrix.of(context).client,
).show(context);

View File

@ -1,3 +1,4 @@
import 'package:fluffychat/utils/fluffy_share.dart';
import 'package:flutter/material.dart';
import 'package:flutter_gen/gen_l10n/l10n.dart';
@ -20,6 +21,9 @@ class SettingsView extends StatelessWidget {
Widget build(BuildContext context) {
return Scaffold(
appBar: AppBar(
leading: CloseButton(
onPressed: VRouter.of(context).pop,
),
title: Text(L10n.of(context)!.settings),
actions: [
TextButton.icon(
@ -111,7 +115,7 @@ class SettingsView extends StatelessWidget {
subtitle: Align(
alignment: Alignment.centerLeft,
child: TextButton.icon(
onPressed: () {},
onPressed: () => FluffyShare.share(mxid, context),
icon: const Icon(
Icons.copy_outlined,
size: 14,
@ -139,9 +143,7 @@ class SettingsView extends StatelessWidget {
value: controller.showChatBackupBanner == false,
secondary: const Icon(Icons.backup_outlined),
title: Text(L10n.of(context)!.chatBackup),
onChanged: controller.showChatBackupBanner != false
? controller.firstRunBootstrapAction
: null,
onChanged: controller.firstRunBootstrapAction,
),
const Divider(thickness: 1),
ListTile(