From 74d167e503e8726bc37f17d84bc4cdcfd70c6086 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 14 Feb 2019 00:35:21 +0100 Subject: [PATCH] GitSetup SSH Keys: Show an explicit loading page When the SSH Key is being generated, nothing can really be done. The text can be read, but it cannot really be acted upon, and it's not super clear that one is just supposed to wait. --- lib/screens/githostsetup_sshkey.dart | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/lib/screens/githostsetup_sshkey.dart b/lib/screens/githostsetup_sshkey.dart index 3b89d2b5..3e9a878a 100644 --- a/lib/screens/githostsetup_sshkey.dart +++ b/lib/screens/githostsetup_sshkey.dart @@ -1,6 +1,7 @@ import 'package:flutter/material.dart'; import 'githostsetup_button.dart'; +import 'githostsetup_loading.dart'; class GitHostSetupSshKey extends StatelessWidget { final Function doneFunction; @@ -20,6 +21,10 @@ class GitHostSetupSshKey extends StatelessWidget { @override Widget build(BuildContext context) { + if (this.publicKey == null || this.publicKey.isEmpty) { + return GitHostSetupLoadingPage("Generating SSH Key ..."); + } + Widget copyAndDepoyWidget; Widget cloneButton; if (this.publicKey.isEmpty) { @@ -68,13 +73,6 @@ class GitHostSetupSshKey extends StatelessWidget { } } - String publicKeyStr = ""; - if (this.publicKey == null || this.publicKey.isEmpty) { - publicKeyStr = "Generating ..."; - } else { - publicKeyStr = this.publicKey; - } - var publicKeyWidget = SizedBox( width: double.infinity, height: 160.0, @@ -84,7 +82,7 @@ class GitHostSetupSshKey extends StatelessWidget { child: Container( padding: const EdgeInsets.all(8.0), child: Text( - publicKeyStr, + publicKey, textAlign: TextAlign.left, maxLines: null, style: Theme.of(context).textTheme.body1,