- add help for ssh virt keys
- rm unused lib
This commit is contained in:
lollipopkit
2023-07-29 16:24:47 +08:00
parent 1163f2e418
commit 7f4dcc1357
31 changed files with 159 additions and 172 deletions

View File

@@ -76,18 +76,6 @@ class _SFTPDownloadedPageState extends State<SFTPDownloadedPage> {
bottomNavigationBar: SafeArea(
child: _buildPath(),
),
floatingActionButtonLocation: FloatingActionButtonLocation.centerFloat,
floatingActionButton: FloatingActionButton(
onPressed: (() {
if (_path!.path == _prefixPath) {
showSnackBar(context, Text(_s.alreadyLastDir));
return;
}
_path!.update('..');
setState(() {});
}),
child: const Icon(Icons.keyboard_arrow_left),
),
);
}
@@ -112,10 +100,22 @@ class _SFTPDownloadedPageState extends State<SFTPDownloadedPage> {
}
final dir = Directory(_path!.path);
final files = dir.listSync();
final canGoBack = _path!.path != _prefixPath;
return ListView.builder(
itemCount: files.length,
itemCount: canGoBack ? files.length + 1 : files.length,
padding: const EdgeInsets.symmetric(vertical: 3, horizontal: 7),
itemBuilder: (context, index) {
if (index == 0 && canGoBack) {
return RoundRectCard(ListTile(
leading: const Icon(Icons.keyboard_arrow_left),
title: const Text('..'),
onTap: () {
_path!.update('..');
setState(() {});
},
));
}
index = canGoBack ? index - 1 : index;
var file = files[index];
var fileName = file.path.split('/').last;
var stat = file.statSync();