Change SFTP to single column

This commit is contained in:
Junyuan Feng
2022-03-08 18:00:46 +08:00
parent 241002c3ea
commit 7a5516792c
2 changed files with 62 additions and 108 deletions

View File

@@ -3,43 +3,12 @@ import 'package:toolbox/data/model/server/server_private_info.dart';
import 'package:toolbox/data/model/sftp/absolute_path.dart';
class SFTPSideViewStatus {
bool leftSelected = false;
bool rightSelected = false;
ServerPrivateInfo? leftSpi;
ServerPrivateInfo? rightSpi;
List<SftpName>? leftFiles;
List<SftpName>? rightFiles;
AbsolutePath? leftPath;
AbsolutePath? rightPath;
SftpClient? leftClient;
SftpClient? rightClient;
bool isBusyLeft = false;
bool isBusyRight = false;
bool selected = false;
ServerPrivateInfo? spi;
List<SftpName>? files;
AbsolutePath? path;
SftpClient? client;
bool isBusy = false;
SFTPSideViewStatus();
ServerPrivateInfo? spi(bool left) => left ? leftSpi : rightSpi;
void setSpi(bool left, ServerPrivateInfo nSpi) =>
left ? leftSpi = nSpi : rightSpi = nSpi;
/// Whether the Left/Right Destination is selected.
bool selected(bool left) => left ? leftSelected : rightSelected;
void setSelect(bool left, bool nSelect) =>
left ? leftSelected = nSelect : rightSelected = nSelect;
List<SftpName>? files(bool left) => left ? leftFiles : rightFiles;
void setFiles(bool left, List<SftpName>? nFiles) =>
left ? leftFiles = nFiles : rightFiles = nFiles;
AbsolutePath? path(bool left) => left ? leftPath : rightPath;
void setPath(bool left, AbsolutePath? nPath) =>
left ? leftPath = nPath : rightPath = nPath;
SftpClient? client(bool left) => left ? leftClient : rightClient;
void setClient(bool left, SftpClient? nClient) =>
left ? leftClient = nClient : rightClient = nClient;
bool isBusy(bool left) => left ? isBusyLeft : isBusyRight;
void setBusy(bool left, bool nBusy) =>
left ? isBusyLeft = nBusy : isBusyRight = nBusy;
}