mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-17 23:34:24 +01:00
#96 opt.
This commit is contained in:
@@ -88,11 +88,24 @@ class _SftpPageState extends State<SftpPage> {
|
||||
),
|
||||
],
|
||||
),
|
||||
body: _buildFileView(),
|
||||
body: _buildBody(),
|
||||
bottomNavigationBar: _buildBottom(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBody() {
|
||||
return WillPopScope(
|
||||
onWillPop: () async {
|
||||
if (_status.path == null || _status.path?.path == '/') {
|
||||
return true;
|
||||
}
|
||||
await _backward();
|
||||
return false;
|
||||
},
|
||||
child: _buildFileView(),
|
||||
);
|
||||
}
|
||||
|
||||
Widget _buildBottom() {
|
||||
final children = widget.selectPath
|
||||
? [
|
||||
@@ -629,6 +642,14 @@ class _SftpPageState extends State<SftpPage> {
|
||||
if (fs.isNotEmpty && fs.first.filename == '.') {
|
||||
fs.removeAt(0);
|
||||
}
|
||||
|
||||
/// Issue #96
|
||||
/// Due to [WillPopScope] added in this page
|
||||
/// There is no need to keep '..' folder in listdir
|
||||
/// So remove it
|
||||
if (fs.isNotEmpty && fs.first.filename == '..') {
|
||||
fs.removeAt(0);
|
||||
}
|
||||
if (mounted) {
|
||||
setState(() {
|
||||
_status.files = fs;
|
||||
|
||||
Reference in New Issue
Block a user