[pve-devel] [PATCH pve_flutter_frontend] main: add check to show welcome screen only when no server configured

Aaron Lauterer a.lauterer at proxmox.com
Mon Dec 14 09:59:52 CET 2020


This additional check will make sure that people who have been using the
app already do not get to see the welcome screen.

In that situation we also want to make sure that we set the shared pref
for the welcome screen to the same state as if it has been seen.

Signed-off-by: Aaron Lauterer <a.lauterer at proxmox.com>
---

I am still unsure if we shouldn't just show the welcome screen to
everyone at least once but that might annoy quite a lot of people though :/

So I prepared this patch should we decide against it.

It needs the following patches applied first [0]

The slightly weird formatting of the if clause is caused by the dart
auto formatter.

[0] https://lists.proxmox.com/pipermail/pve-devel/2020-December/046451.html

 lib/main.dart | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/lib/main.dart b/lib/main.dart
index 57ad39c..4b490e3 100644
--- a/lib/main.dart
+++ b/lib/main.dart
@@ -149,10 +149,13 @@ class MyApp extends StatelessWidget {
               builder: (context) => PveSplashScreen(),
             );
           }
-          if (sharedPreferences.getBool('showWelcomeScreen') ?? true) {
+          if (sharedPreferences.getBool('showWelcomeScreen') ??
+              true && !sharedPreferences.containsKey('ProxmoxLoginList')) {
             return MaterialPageRoute(
               builder: (context) => PveWelcome(),
             );
+          } else if (!sharedPreferences.containsKey('showWelcomeScreen')) {
+            sharedPreferences.setBool('showWelcomeScreen', false);
           }
 
           if (authbloc.state.value is Unauthenticated ||
-- 
2.20.1






More information about the pve-devel mailing list