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.
This commit is contained in:
Vishesh Handa
2019-02-14 00:35:21 +01:00
parent eab5506fe2
commit 74d167e503

View File

@ -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,