mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 07:14:28 +01:00
App更新优化
This commit is contained in:
@@ -38,7 +38,9 @@ Future<void> 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));
|
||||
}
|
||||
|
||||
@@ -184,44 +184,49 @@ class _ServerPageState extends State<ServerPage>
|
||||
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);
|
||||
});
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user