From 28fcc65772e572ea8ab7233b064fbc4322d91a74 Mon Sep 17 00:00:00 2001 From: Vishesh Handa Date: Thu, 14 Feb 2019 00:54:35 +0100 Subject: [PATCH] GitSetup: Add instructions on SSH Key page --- lib/screens/githostsetup_sshkey.dart | 117 ++++++++++++++++++--------- 1 file changed, 79 insertions(+), 38 deletions(-) diff --git a/lib/screens/githostsetup_sshkey.dart b/lib/screens/githostsetup_sshkey.dart index 3e9a878a..67ea0b92 100644 --- a/lib/screens/githostsetup_sshkey.dart +++ b/lib/screens/githostsetup_sshkey.dart @@ -25,7 +25,84 @@ class GitHostSetupSshKey extends StatelessWidget { return GitHostSetupLoadingPage("Generating SSH Key ..."); } - Widget copyAndDepoyWidget; + var publicKeyWidget = SizedBox( + width: double.infinity, + height: 160.0, + child: Container( + color: Theme.of(context).buttonColor, + child: SingleChildScrollView( + child: Container( + padding: const EdgeInsets.all(8.0), + child: Text( + publicKey, + textAlign: TextAlign.left, + maxLines: null, + style: Theme.of(context).textTheme.body1, + ), + ), + ), + ), + ); + + var columns = Column( + mainAxisAlignment: MainAxisAlignment.center, + crossAxisAlignment: CrossAxisAlignment.start, + children: [ + Text( + 'In order to access this repository, this public key must be copied as a deploy key', + style: Theme.of(context).textTheme.title, + ), + SizedBox(height: 32.0), + + // Step 1 + Text( + '1. Copy the key', + style: Theme.of(context).textTheme.subtitle, + ), + SizedBox(height: 8.0), + publicKeyWidget, + SizedBox(height: 8.0), + GitHostSetupButton( + text: "Copy Key", + onPressed: copyKeyFunction, + ), + SizedBox(height: 16.0), + + // Step 2 + Text( + '2. Open webpage, and paste the deploy key. Make sure it is given Write Access. ', + style: Theme.of(context).textTheme.subtitle, + ), + SizedBox(height: 8.0), + GitHostSetupButton( + text: "Open Deploy Key Webpage", + onPressed: openDeployKeyPage, + ), + SizedBox(height: 16.0), + + // Step 3 + Text( + '3. Try Cloning ..', + style: Theme.of(context).textTheme.subtitle, + ), + SizedBox(height: 8.0), + GitHostSetupButton( + text: "Clone Repo", + onPressed: this.doneFunction, + ), + ], + ); + + return Center( + child: SingleChildScrollView( + child: columns, + ), + ); + } +} + +/* +Widget copyAndDepoyWidget; Widget cloneButton; if (this.publicKey.isEmpty) { copyAndDepoyWidget = Container(); @@ -72,40 +149,4 @@ class GitHostSetupSshKey extends StatelessWidget { ); } } - - var publicKeyWidget = SizedBox( - width: double.infinity, - height: 160.0, - child: Container( - color: Theme.of(context).buttonColor, - child: SingleChildScrollView( - child: Container( - padding: const EdgeInsets.all(8.0), - child: Text( - publicKey, - textAlign: TextAlign.left, - maxLines: null, - style: Theme.of(context).textTheme.body1, - ), - ), - ), - ), - ); - - return Column( - mainAxisAlignment: MainAxisAlignment.center, - crossAxisAlignment: CrossAxisAlignment.start, - children: [ - Text( - 'Deploy Public Key', - style: Theme.of(context).textTheme.headline, - ), - SizedBox(height: 16.0), - publicKeyWidget, - SizedBox(height: 8.0), - copyAndDepoyWidget, - cloneButton, - ], - ); - } -} + */