mirror of
https://github.com/lollipopkit/flutter_server_box.git
synced 2025-12-18 07:44:26 +01:00
#96 opt.
This commit is contained in:
@@ -88,11 +88,24 @@ class _SftpPageState extends State<SftpPage> {
|
|||||||
),
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
body: _buildFileView(),
|
body: _buildBody(),
|
||||||
bottomNavigationBar: _buildBottom(),
|
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() {
|
Widget _buildBottom() {
|
||||||
final children = widget.selectPath
|
final children = widget.selectPath
|
||||||
? [
|
? [
|
||||||
@@ -629,6 +642,14 @@ class _SftpPageState extends State<SftpPage> {
|
|||||||
if (fs.isNotEmpty && fs.first.filename == '.') {
|
if (fs.isNotEmpty && fs.first.filename == '.') {
|
||||||
fs.removeAt(0);
|
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) {
|
if (mounted) {
|
||||||
setState(() {
|
setState(() {
|
||||||
_status.files = fs;
|
_status.files = fs;
|
||||||
|
|||||||
Reference in New Issue
Block a user