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(
|
showSnackBarWithAction(
|
||||||
context,
|
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));
|
() => openUrl(Platform.isAndroid ? update.android : update.ios));
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -184,44 +184,49 @@ class _ServerPageState extends State<ServerPage>
|
|||||||
keyController.text = auth['privateKey'];
|
keyController.text = auth['privateKey'];
|
||||||
}
|
}
|
||||||
|
|
||||||
showRoundDialog(context, '修改服务器信息', _buildTextInputField(context), [
|
showRoundDialog(
|
||||||
TextButton(
|
context,
|
||||||
onPressed: () {
|
'修改服务器信息',
|
||||||
clearTextField();
|
_buildTextInputField(context),
|
||||||
Navigator.of(context).pop();
|
[
|
||||||
},
|
TextButton(
|
||||||
child: const Text('关闭')),
|
onPressed: () {
|
||||||
TextButton(
|
clearTextField();
|
||||||
onPressed: () {
|
Navigator.of(context).pop();
|
||||||
final authorization = keyController.text.isEmpty
|
},
|
||||||
? passwordController.text
|
child: const Text('关闭')),
|
||||||
: {
|
TextButton(
|
||||||
"privateKey": keyController.text,
|
onPressed: () {
|
||||||
"passphrase": passwordController.text
|
final authorization = keyController.text.isEmpty
|
||||||
};
|
? passwordController.text
|
||||||
serverProvider.updateServer(
|
: {
|
||||||
spi,
|
"privateKey": keyController.text,
|
||||||
ServerPrivateInfo(
|
"passphrase": passwordController.text
|
||||||
name: nameController.text,
|
};
|
||||||
ip: ipController.text,
|
serverProvider.updateServer(
|
||||||
port: int.parse(portController.text),
|
spi,
|
||||||
user: usernameController.text,
|
ServerPrivateInfo(
|
||||||
authorization: authorization));
|
name: nameController.text,
|
||||||
clearTextField();
|
ip: ipController.text,
|
||||||
Navigator.of(context).pop();
|
port: int.parse(portController.text),
|
||||||
},
|
user: usernameController.text,
|
||||||
child: const Text('保存')),
|
authorization: authorization));
|
||||||
TextButton(
|
clearTextField();
|
||||||
onPressed: () {
|
Navigator.of(context).pop();
|
||||||
serverProvider.delServer(spi);
|
},
|
||||||
clearTextField();
|
child: const Text('保存')),
|
||||||
Navigator.of(context).pop();
|
TextButton(
|
||||||
},
|
onPressed: () {
|
||||||
child: const Text(
|
serverProvider.delServer(spi);
|
||||||
'删除',
|
clearTextField();
|
||||||
style: TextStyle(color: Colors.red),
|
Navigator.of(context).pop();
|
||||||
))
|
},
|
||||||
], barrierDismiss: false);
|
child: const Text(
|
||||||
|
'删除',
|
||||||
|
style: TextStyle(color: Colors.red),
|
||||||
|
))
|
||||||
|
],
|
||||||
|
barrierDismiss: false);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user