From f457c7caeec792067e67e093a961079efb1971f7 Mon Sep 17 00:00:00 2001 From: LollipopKit <2036293523@qq.com> Date: Sat, 18 Sep 2021 20:23:28 +0800 Subject: [PATCH] =?UTF-8?q?App=E6=9B=B4=E6=96=B0=E4=BC=98=E5=8C=96?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- lib/core/update.dart | 4 +- lib/view/page/server.dart | 81 +++++++++++++++++++++------------------ make.dart | 1 - 3 files changed, 46 insertions(+), 40 deletions(-) diff --git a/lib/core/update.dart b/lib/core/update.dart index d962c46f..a17d2a4c 100644 --- a/lib/core/update.dart +++ b/lib/core/update.dart @@ -38,7 +38,9 @@ Future doUpdate(BuildContext context, {bool force = false}) async { showSnackBarWithAction( context, - '${BuildData.name}有更新啦,Ver:${update.newest}\n${update.changelog}', + update.min > BuildData.build + ? '您的版本过旧,请及时更新' + : '${BuildData.name}有更新啦,Ver:${update.newest}\n${update.changelog}', '更新', () => openUrl(Platform.isAndroid ? update.android : update.ios)); } diff --git a/lib/view/page/server.dart b/lib/view/page/server.dart index 5f722b40..8f4a0bb6 100644 --- a/lib/view/page/server.dart +++ b/lib/view/page/server.dart @@ -184,44 +184,49 @@ class _ServerPageState extends State keyController.text = auth['privateKey']; } - showRoundDialog(context, '修改服务器信息', _buildTextInputField(context), [ - TextButton( - onPressed: () { - clearTextField(); - Navigator.of(context).pop(); - }, - child: const Text('关闭')), - TextButton( - onPressed: () { - final authorization = keyController.text.isEmpty - ? passwordController.text - : { - "privateKey": keyController.text, - "passphrase": passwordController.text - }; - serverProvider.updateServer( - spi, - ServerPrivateInfo( - name: nameController.text, - ip: ipController.text, - port: int.parse(portController.text), - user: usernameController.text, - authorization: authorization)); - clearTextField(); - Navigator.of(context).pop(); - }, - child: const Text('保存')), - TextButton( - onPressed: () { - serverProvider.delServer(spi); - clearTextField(); - Navigator.of(context).pop(); - }, - child: const Text( - '删除', - style: TextStyle(color: Colors.red), - )) - ], barrierDismiss: false); + showRoundDialog( + context, + '修改服务器信息', + _buildTextInputField(context), + [ + TextButton( + onPressed: () { + clearTextField(); + Navigator.of(context).pop(); + }, + child: const Text('关闭')), + TextButton( + onPressed: () { + final authorization = keyController.text.isEmpty + ? passwordController.text + : { + "privateKey": keyController.text, + "passphrase": passwordController.text + }; + serverProvider.updateServer( + spi, + ServerPrivateInfo( + name: nameController.text, + ip: ipController.text, + port: int.parse(portController.text), + user: usernameController.text, + authorization: authorization)); + clearTextField(); + Navigator.of(context).pop(); + }, + child: const Text('保存')), + TextButton( + onPressed: () { + serverProvider.delServer(spi); + clearTextField(); + Navigator.of(context).pop(); + }, + child: const Text( + '删除', + style: TextStyle(color: Colors.red), + )) + ], + barrierDismiss: false); }); } diff --git a/make.dart b/make.dart index 6e664997..e832310f 100755 --- a/make.dart +++ b/make.dart @@ -1,5 +1,4 @@ #!/usr/bin/env dart - // ignore_for_file: avoid_print import 'dart:convert';