[pve-devel] [PATCH proxmox_login_manager v2 2/2] ui: settings: add privacy policy url link in settings screen

Shan Shaji s.shaji at proxmox.com
Fri Jul 4 17:26:54 CEST 2025


According to Apple's App Store review guidelines all apps must include a
link to their privacy policy within the App [0]. To fix the issue add a
new list item in the settings screen that will allow users to access the
privacy policy.

[0] - https://developer.apple.com/app-store/review/guidelines/#legal

Signed-off-by: Shan Shaji <s.shaji at proxmox.com>
---
 
changes since v1:
 - Move all .lock file changes to another patch.
 - Remove wrapper class around link constants.
 - Remove all custom widgets and use flutter default widgets
 - Remove result class

 note: The `flutter pub get` command triggered the .lock 
 file change. 
 
 lib/constants/pve_links.dart           |  2 +
 lib/proxmox_general_settings_form.dart | 28 +++++++++++
 lib/utils/pve_url_launcher_util.dart   |  9 ++++
 pubspec.lock                           | 66 +++++++++++++++++++++++++-
 pubspec.yaml                           |  1 +
 5 files changed, 105 insertions(+), 1 deletion(-)
 create mode 100644 lib/constants/pve_links.dart
 create mode 100644 lib/utils/pve_url_launcher_util.dart

diff --git a/lib/constants/pve_links.dart b/lib/constants/pve_links.dart
new file mode 100644
index 0000000..4dc0eaf
--- /dev/null
+++ b/lib/constants/pve_links.dart
@@ -0,0 +1,2 @@
+const String privacyPolicyUrl =
+    'https://pve.proxmox.com/wiki/Proxmox_VE_Mobile_Companion_Data_Protection';
diff --git a/lib/proxmox_general_settings_form.dart b/lib/proxmox_general_settings_form.dart
index cb0afef..4f95641 100644
--- a/lib/proxmox_general_settings_form.dart
+++ b/lib/proxmox_general_settings_form.dart
@@ -1,5 +1,7 @@
 import 'package:flutter/material.dart';
+import 'package:proxmox_login_manager/constants/pve_links.dart';
 import 'package:proxmox_login_manager/proxmox_general_settings_model.dart';
+import 'package:proxmox_login_manager/utils/pve_url_launcher_util.dart';
 
 class ProxmoxGeneralSettingsForm extends StatefulWidget {
   const ProxmoxGeneralSettingsForm({super.key});
@@ -45,6 +47,32 @@ class _ProxmoxGeneralSettingsFormState
                               ProxmoxGeneralSettingsModel.fromLocalStorage();
                         });
                       },
+                    ),
+                    const ListTile(
+                      title: Text(
+                        'LEGAL',
+                        style: TextStyle(
+                          fontWeight: FontWeight.bold,
+                        ),
+                      ),
+                    ),
+                    ListTile(
+                      leading: const Icon(Icons.privacy_tip_outlined),
+                      title: const Text('Privacy Policy'),
+                      trailing: const Icon(Icons.open_in_new),
+                      onTap: () {
+                        try {
+                          tryLaunchUrl(Uri.parse(privacyPolicyUrl));
+                        } catch (_) {
+                          ScaffoldMessenger.of(context).showSnackBar(
+                            const SnackBar(
+                              content: Text(
+                                'Could not launch privacy policy',
+                              ),
+                            ),
+                          );
+                        }
+                      },
                     )
                   ],
                 ),
diff --git a/lib/utils/pve_url_launcher_util.dart b/lib/utils/pve_url_launcher_util.dart
new file mode 100644
index 0000000..0ea7cbe
--- /dev/null
+++ b/lib/utils/pve_url_launcher_util.dart
@@ -0,0 +1,9 @@
+import 'package:url_launcher/url_launcher.dart';
+
+Future<bool> tryLaunchUrl(Uri url) async {
+  if (await canLaunchUrl(url)) {
+    return await launchUrl(url);
+  } else {
+    throw 'Could not launch $url';
+  }
+}
diff --git a/pubspec.lock b/pubspec.lock
index 2ceaa65..6163a50 100644
--- a/pubspec.lock
+++ b/pubspec.lock
@@ -636,6 +636,70 @@ packages:
       url: "https://pub.dev"
     source: hosted
     version: "1.3.2"
+  url_launcher:
+    dependency: "direct main"
+    description:
+      name: url_launcher
+      sha256: "9d06212b1362abc2f0f0d78e6f09f726608c74e3b9462e8368bb03314aa8d603"
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.3.1"
+  url_launcher_android:
+    dependency: transitive
+    description:
+      name: url_launcher_android
+      sha256: "8582d7f6fe14d2652b4c45c9b6c14c0b678c2af2d083a11b604caeba51930d79"
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.3.16"
+  url_launcher_ios:
+    dependency: transitive
+    description:
+      name: url_launcher_ios
+      sha256: "7f2022359d4c099eea7df3fdf739f7d3d3b9faf3166fb1dd390775176e0b76cb"
+      url: "https://pub.dev"
+    source: hosted
+    version: "6.3.3"
+  url_launcher_linux:
+    dependency: transitive
+    description:
+      name: url_launcher_linux
+      sha256: "4e9ba368772369e3e08f231d2301b4ef72b9ff87c31192ef471b380ef29a4935"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.2.1"
+  url_launcher_macos:
+    dependency: transitive
+    description:
+      name: url_launcher_macos
+      sha256: "17ba2000b847f334f16626a574c702b196723af2a289e7a93ffcb79acff855c2"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.2.2"
+  url_launcher_platform_interface:
+    dependency: transitive
+    description:
+      name: url_launcher_platform_interface
+      sha256: "552f8a1e663569be95a8190206a38187b531910283c3e982193e4f2733f01029"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.3.2"
+  url_launcher_web:
+    dependency: transitive
+    description:
+      name: url_launcher_web
+      sha256: "4bd2b7b4dc4d4d0b94e5babfffbca8eac1a126c7f3d6ecbc1a11013faa3abba2"
+      url: "https://pub.dev"
+    source: hosted
+    version: "2.4.1"
+  url_launcher_windows:
+    dependency: transitive
+    description:
+      name: url_launcher_windows
+      sha256: "3284b6d2ac454cf34f114e1d3319866fdd1e19cdc329999057e44ffe936cfa77"
+      url: "https://pub.dev"
+    source: hosted
+    version: "3.1.4"
   vector_math:
     dependency: transitive
     description:
@@ -702,4 +766,4 @@ packages:
     version: "3.1.2"
 sdks:
   dart: ">=3.7.0-0 <4.0.0"
-  flutter: ">=3.19.0"
+  flutter: ">=3.27.0"
diff --git a/pubspec.yaml b/pubspec.yaml
index 99f9870..1e48217 100644
--- a/pubspec.yaml
+++ b/pubspec.yaml
@@ -14,6 +14,7 @@ dependencies:
   biometric_storage: ^5.0.0
   built_value: ^8.4.1
   built_collection: ^5.0.0
+  url_launcher: ^6.3.1
   proxmox_dart_api_client:
     path: ../proxmox_dart_api_client
 
-- 
2.39.5 (Apple Git-154)





More information about the pve-devel mailing list