mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-02-08 01:05:08 +01:00
fix: CRLF of private key (#7)
This commit is contained in:
@@ -2,9 +2,9 @@
|
||||
|
||||
class BuildData {
|
||||
static const String name = "ServerBox";
|
||||
static const int build = 702;
|
||||
static const String engine = "3.16.6";
|
||||
static const String buildAt = "2024-01-11 21:40:36";
|
||||
static const int modifications = 3;
|
||||
static const int build = 703;
|
||||
static const String engine = "3.16.7";
|
||||
static const String buildAt = "2024-01-14 19:40:49";
|
||||
static const int modifications = 6;
|
||||
static const int script = 34;
|
||||
}
|
||||
|
||||
@@ -84,7 +84,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
|
||||
);
|
||||
}
|
||||
|
||||
PreferredSizeWidget _buildAppBar() {
|
||||
CustomAppBar _buildAppBar() {
|
||||
final actions = [
|
||||
IconButton(
|
||||
tooltip: l10n.delete,
|
||||
@@ -181,10 +181,7 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
|
||||
TextButton(
|
||||
onPressed: () async {
|
||||
final path = await pickOneFile();
|
||||
if (path == null) {
|
||||
context.showSnackBar(l10n.fieldMustNotEmpty);
|
||||
return;
|
||||
}
|
||||
if (path == null) return;
|
||||
|
||||
final file = File(path);
|
||||
if (!file.existsSync()) {
|
||||
@@ -203,7 +200,12 @@ class _PrivateKeyEditPageState extends State<PrivateKeyEditPage> {
|
||||
return;
|
||||
}
|
||||
|
||||
_keyController.text = await file.readAsString();
|
||||
final content = await file.readAsString();
|
||||
|
||||
/// Issue #7
|
||||
/// Replace all CRLF to LF
|
||||
content.replaceAll('\r\n', '\n');
|
||||
_keyController.text = content;
|
||||
},
|
||||
child: Text(l10n.pickFile),
|
||||
),
|
||||
|
||||
Reference in New Issue
Block a user