From: Shan Shaji <s.shaji@proxmox.com>
To: pve-devel@lists.proxmox.com
Subject: [pve-devel] [PATCH proxmox_login_manager 1/1] refactor: ui: move settings page to `pve_flutter_frontend`
Date: Fri, 1 Aug 2025 12:00:51 +0200 [thread overview]
Message-ID: <20250801100051.83035-3-s.shaji@proxmox.com> (raw)
In-Reply-To: <20250801100051.83035-1-s.shaji@proxmox.com>
The setting screen UI was previously defined in this repo. If a new app
settings needs to be added eg: privacy policy link, app version string.
The change had to be done in the package even though the change is not
package specific.
Inorder to fix that, move settings page to `pve_flutter_frontend` and use
`ProxmoxGeneralSettingsForm` as a widget in the new settings page.
Signed-off-by: Shan Shaji <s.shaji@proxmox.com>
---
lib/proxmox_general_settings_form.dart | 58 +++++++++++---------------
lib/proxmox_login_form.dart | 5 +--
lib/proxmox_login_selector.dart | 13 +++---
3 files changed, 31 insertions(+), 45 deletions(-)
diff --git a/lib/proxmox_general_settings_form.dart b/lib/proxmox_general_settings_form.dart
index cb0afef..e39f91d 100644
--- a/lib/proxmox_general_settings_form.dart
+++ b/lib/proxmox_general_settings_form.dart
@@ -12,6 +12,7 @@ class ProxmoxGeneralSettingsForm extends StatefulWidget {
class _ProxmoxGeneralSettingsFormState
extends State<ProxmoxGeneralSettingsForm> {
Future<ProxmoxGeneralSettingsModel>? _settings;
+
@override
void initState() {
super.initState();
@@ -20,41 +21,30 @@ class _ProxmoxGeneralSettingsFormState
@override
Widget build(BuildContext context) {
- return Scaffold(
- appBar: AppBar(
- title: const Text('Settings'),
- ),
- body: FutureBuilder<ProxmoxGeneralSettingsModel>(
- future: _settings,
- builder: (context, snaptshot) {
- if (snaptshot.hasData) {
- final settings = snaptshot.data!;
- return SingleChildScrollView(
- child: Column(
- children: [
- SwitchListTile(
- title: const Text('Validate SSL connections'),
- subtitle: const Text('e.g. validates certificates'),
- value: settings.sslValidation!,
- onChanged: (value) async {
- await settings
- .rebuild((b) => b.sslValidation = value)
- .toLocalStorage();
- setState(() {
- _settings =
- ProxmoxGeneralSettingsModel.fromLocalStorage();
- });
- },
- )
- ],
- ),
- );
- }
+ return FutureBuilder<ProxmoxGeneralSettingsModel>(
+ future: _settings,
+ builder: (context, snapShot) {
+ if (snapShot.hasData) {
+ final settings = snapShot.data!;
+ return SwitchListTile(
+ title: const Text('Validate SSL connections'),
+ subtitle: const Text('e.g. validates certificates'),
+ value: settings.sslValidation!,
+ onChanged: (value) async {
+ await settings
+ .rebuild((b) => b.sslValidation = value)
+ .toLocalStorage();
+ setState(() {
+ _settings = ProxmoxGeneralSettingsModel.fromLocalStorage();
+ });
+ },
+ );
+ }
- return const Center(
- child: CircularProgressIndicator(),
- );
- }),
+ return const Center(
+ child: CircularProgressIndicator(),
+ );
+ },
);
}
}
diff --git a/lib/proxmox_login_form.dart b/lib/proxmox_login_form.dart
index 5a2db3b..db9994b 100644
--- a/lib/proxmox_login_form.dart
+++ b/lib/proxmox_login_form.dart
@@ -6,7 +6,6 @@ import 'package:collection/collection.dart';
import 'package:proxmox_dart_api_client/proxmox_dart_api_client.dart'
as proxclient;
import 'package:proxmox_dart_api_client/proxmox_dart_api_client.dart';
-import 'package:proxmox_login_manager/proxmox_general_settings_form.dart';
import 'package:proxmox_login_manager/proxmox_general_settings_model.dart';
import 'package:proxmox_login_manager/proxmox_login_model.dart';
import 'package:proxmox_login_manager/proxmox_tfa_form.dart';
@@ -829,9 +828,7 @@ class ProxmoxCertificateErrorDialog extends StatelessWidget {
child: const Text('Close'),
),
TextButton(
- onPressed: () => Navigator.of(context).pushReplacement(
- MaterialPageRoute(
- builder: (context) => const ProxmoxGeneralSettingsForm())),
+ onPressed: () => Navigator.popAndPushNamed(context, '/settings'),
child: const Text('Settings'),
)
],
diff --git a/lib/proxmox_login_selector.dart b/lib/proxmox_login_selector.dart
index ba84d7d..c8d9813 100644
--- a/lib/proxmox_login_selector.dart
+++ b/lib/proxmox_login_selector.dart
@@ -1,6 +1,5 @@
import 'package:flutter/material.dart';
import 'package:built_collection/built_collection.dart';
-import 'package:proxmox_login_manager/proxmox_general_settings_form.dart';
import 'package:proxmox_login_manager/proxmox_login_form.dart';
import 'package:proxmox_login_manager/proxmox_login_model.dart';
import 'package:proxmox_dart_api_client/proxmox_dart_api_client.dart'
@@ -52,12 +51,12 @@ class _ProxmoxLoginSelectorState extends State<ProxmoxLoginSelector> {
),
actions: [
IconButton(
- icon: const Icon(Icons.settings),
- onPressed: () {
- Navigator.of(context).push(MaterialPageRoute(
- builder: (context) => const ProxmoxGeneralSettingsForm(),
- ));
- })
+ icon: const Icon(Icons.settings),
+ onPressed: () => Navigator.pushNamed(
+ context,
+ '/settings',
+ ),
+ )
],
),
body: FutureBuilder<ProxmoxLoginStorage?>(
--
2.39.5
_______________________________________________
pve-devel mailing list
pve-devel@lists.proxmox.com
https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel
next prev parent reply other threads:[~2025-08-01 9:59 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-01 10:00 [pve-devel] [PATCH proxmox_login_manager/pve_flutter_frontend 0/2] refactor: ui: add new settings page in `pve_flutter_frontend` Shan Shaji
2025-08-01 10:00 ` [pve-devel] [PATCH pve_flutter_frontend 1/1] refactor: ui: add new settings page and use existing ssl toggle widget Shan Shaji
2025-08-01 10:00 ` Shan Shaji [this message]
2025-08-13 13:56 ` [pve-devel] [PATCH proxmox_login_manager/pve_flutter_frontend 0/2] refactor: ui: add new settings page in `pve_flutter_frontend` Dominik Csapak
2025-08-14 8:15 ` Shan Shaji
2025-08-22 9:35 ` Thomas Lamprecht
2025-08-29 11:55 ` Shan Shaji
2025-08-29 11:48 [pve-devel] [PATCH proxmox_login_manager/pve_flutter_frontend 0/4] refactor settings screen and add HELP, LEGAL section in settings Shan Shaji
2025-08-29 11:48 ` [pve-devel] [PATCH proxmox_login_manager 1/1] refactor: ui: move settings page to `pve_flutter_frontend` Shan Shaji
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20250801100051.83035-3-s.shaji@proxmox.com \
--to=s.shaji@proxmox.com \
--cc=pve-devel@lists.proxmox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox