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; bool? showChatBackupBanner;
void firstRunBootstrapAction([_]) async { 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( await BootstrapDialog(
client: Matrix.of(context).client, client: Matrix.of(context).client,
).show(context); ).show(context);

View File

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