mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2026-01-31 13:25:10 +01:00
fix & optimize
- fix downloading page unbond size - auto dispose isolate
This commit is contained in:
@@ -47,7 +47,7 @@ class _SFTPDownloadingPageState extends State<SFTPDownloadingPage> {
|
||||
);
|
||||
}
|
||||
return ListView.builder(
|
||||
padding: const EdgeInsets.all(13),
|
||||
padding: const EdgeInsets.all(11),
|
||||
itemCount: pro.status.length,
|
||||
itemBuilder: (context, index) {
|
||||
final status = pro.status[index];
|
||||
@@ -78,7 +78,7 @@ class _SFTPDownloadingPageState extends State<SFTPDownloadingPage> {
|
||||
switch (status.status) {
|
||||
case SftpWorkerStatus.finished:
|
||||
return _wrapInCard(status,
|
||||
'${s.downloadFinished}, ${s.spentTime(status.spentTime ?? s.unknown)}',
|
||||
'${s.downloadFinished} ${s.spentTime(status.spentTime ?? s.unknown)}',
|
||||
trailing: IconButton(
|
||||
onPressed: () => Share.shareFiles([status.item.localPath],
|
||||
text: '${status.fileName} from ServerBox'),
|
||||
@@ -91,9 +91,9 @@ class _SFTPDownloadingPageState extends State<SFTPDownloadingPage> {
|
||||
trailing:
|
||||
CircularProgressIndicator(value: (status.progress ?? 0) / 100));
|
||||
case SftpWorkerStatus.preparing:
|
||||
return _wrapInCard(status, s.sftpDlPrepare, trailing: centerLoading);
|
||||
return _wrapInCard(status, s.sftpDlPrepare, trailing: loadingIcon);
|
||||
case SftpWorkerStatus.sshConnectted:
|
||||
return _wrapInCard(status, s.sftpSSHConnected, trailing: centerLoading);
|
||||
return _wrapInCard(status, s.sftpSSHConnected, trailing: loadingIcon);
|
||||
default:
|
||||
return _wrapInCard(status, s.unknown,
|
||||
trailing: const Icon(
|
||||
|
||||
@@ -211,13 +211,17 @@ class _SFTPPageState extends State<SFTPPage> {
|
||||
key: pubKeyId == null
|
||||
? null
|
||||
: locator<PrivateKeyStore>().get(pubKeyId).privateKey);
|
||||
Navigator.of(context).pop();
|
||||
showRoundDialog(context, s.goSftpDlPage, const SizedBox(), [
|
||||
TextButton(
|
||||
onPressed: () => Navigator.of(context).pop(),
|
||||
child: Text(s.cancel)),
|
||||
TextButton(
|
||||
onPressed: () =>
|
||||
AppRoute(const SFTPDownloadingPage(), 'sftp downloading'),
|
||||
onPressed: () {
|
||||
Navigator.of(context).pop();
|
||||
AppRoute(const SFTPDownloadingPage(), 'sftp downloading')
|
||||
.go(context);
|
||||
},
|
||||
child: Text(s.ok))
|
||||
]);
|
||||
},
|
||||
|
||||
@@ -9,3 +9,5 @@ const centerSizedLoading = SizedBox(
|
||||
child: CircularProgressIndicator(),
|
||||
),
|
||||
);
|
||||
|
||||
final loadingIcon = IconButton(onPressed: () {}, icon: centerLoading);
|
||||
|
||||
Reference in New Issue
Block a user