DRAFT:Add support of reading system privatekey (.ssh/id_rsa)

This commit is contained in:
calvin
2023-08-04 18:41:04 +08:00
parent 0260444ca0
commit 486b920d6b
3 changed files with 38 additions and 1 deletions

View File

@@ -1,5 +1,4 @@
import 'dart:io';
import 'package:file_picker/file_picker.dart';
import 'package:flutter/services.dart';
import 'package:flutter/widgets.dart';
@@ -77,3 +76,14 @@ String getTime(int? unixMill) {
String pathJoin(String path1, String path2) {
return path1 + (path1.endsWith('/') ? '' : '/') + path2;
}
String getHome() {
String? home = "";
Map<String, String> envVars = Platform.environment;
if (isMacOS ||isLinux) {
home = envVars['HOME'];
} else if (isWindows) {
home = envVars['UserProfile'];
}
return home??"";
}