new: open sftp with last viewed path

This commit is contained in:
lollipopkit
2023-10-14 23:03:12 +08:00
parent c9d54f4fea
commit a397f81988
14 changed files with 123 additions and 12 deletions

View File

@@ -156,6 +156,8 @@ class _SettingPageState extends State<SettingPage> {
_buildServer(),
_buildTitle('SSH'),
_buildSSH(),
_buildTitle('SFTP'),
_buildSFTP(),
_buildTitle(l10n.editor),
_buildEditor(),
_buildTitle(l10n.fullScreen),
@@ -230,7 +232,6 @@ class _SettingPageState extends State<SettingPage> {
// Use hardware keyboard on desktop, so there is no need to set it
if (isMobile) _buildKeyboardType(),
_buildSSHVirtKeys(),
_buildSftpRmrDir(),
].map((e) => RoundRectCard(e)).toList(),
);
}
@@ -842,6 +843,23 @@ class _SettingPageState extends State<SettingPage> {
);
}
Widget _buildSFTP() {
return Column(
children: [
_buildSftpRmrDir(),
_buildSftpOpenLastPath(),
].map((e) => RoundRectCard(e)).toList(),
);
}
Widget _buildSftpOpenLastPath() {
return ListTile(
title: Text(l10n.openLastPath),
subtitle: Text(l10n.openLastPathTip, style: UIs.textGrey),
trailing: StoreSwitch(prop: _setting.sftpOpenLastPath),
);
}
Widget _buildNetViewType() {
final items = NetViewType.values
.map((e) => PopupMenuItem(