Skip to content

Commit 90f7fb6

Browse files
committed
Remote Setup: Add a button to regenerate the key
1 parent 6986b31 commit 90f7fb6

File tree

2 files changed

+13
-0
lines changed

2 files changed

+13
-0
lines changed

lib/screens/githostsetup_screens.dart

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -177,6 +177,12 @@ class GitHostSetupScreenState extends State<GitHostSetupScreen> {
177177
_startGitClone(context);
178178
});
179179
},
180+
regenerateFunction: () {
181+
setState(() {
182+
publicKey = "";
183+
});
184+
_generateSshKey(context);
185+
},
180186
publicKey: publicKey,
181187
copyKeyFunction: _copyKeyToClipboard,
182188
openDeployKeyPage: _launchDeployKeyPage,

lib/screens/githostsetup_sshkey.dart

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,15 @@ import 'githostsetup_loading.dart';
66

77
class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
88
final Func0<void> doneFunction;
9+
final Func0<void> regenerateFunction;
910
final Func1<BuildContext, void> copyKeyFunction;
1011
final String publicKey;
1112

1213
final Func0<void> openDeployKeyPage;
1314

1415
GitHostSetupSshKeyKnownProvider({
1516
@required this.doneFunction,
17+
@required this.regenerateFunction,
1618
@required this.copyKeyFunction,
1719
@required this.openDeployKeyPage,
1820
@required this.publicKey,
@@ -42,10 +44,15 @@ class GitHostSetupSshKeyKnownProvider extends StatelessWidget {
4244
const SizedBox(height: 8.0),
4345
PublicKeyWidget(publicKey),
4446
const SizedBox(height: 8.0),
47+
4548
GitHostSetupButton(
4649
text: "Copy Key",
4750
onPressed: () => copyKeyFunction(context),
4851
),
52+
GitHostSetupButton(
53+
text: "Regenerate Key",
54+
onPressed: regenerateFunction,
55+
),
4956
const SizedBox(height: 16.0),
5057

5158
// Step 2

0 commit comments

Comments
 (0)