make back gesture work properly
This commit is contained in:
parent
23cd60701c
commit
e86324fa55
1 changed files with 147 additions and 137 deletions
|
@ -78,7 +78,7 @@ class _SftpExplorerState extends State<SftpExplorer> {
|
|||
),
|
||||
IconButton(
|
||||
onPressed: () {
|
||||
|
||||
// TODO: show donwload details here
|
||||
},
|
||||
icon: Icon(Icons.upload)
|
||||
),
|
||||
|
@ -87,7 +87,16 @@ class _SftpExplorerState extends State<SftpExplorer> {
|
|||
],
|
||||
),
|
||||
floatingActionButton: _buildFABs(context),
|
||||
body: AnimatedSwitcher(
|
||||
body: PopScope(
|
||||
canPop: false,
|
||||
onPopInvokedWithResult: (_, _) {
|
||||
if (path != '/') {
|
||||
path = path.substring(0, path.length - 1);
|
||||
path = path.substring(0, path.lastIndexOf('/')+1);
|
||||
_listDir();
|
||||
}
|
||||
},
|
||||
child: AnimatedSwitcher(
|
||||
duration: Duration(milliseconds: 300),
|
||||
transitionBuilder: (child, animation) {
|
||||
final curved = CurvedAnimation(
|
||||
|
@ -224,6 +233,7 @@ class _SftpExplorerState extends State<SftpExplorer> {
|
|||
);
|
||||
},
|
||||
)
|
||||
),
|
||||
)
|
||||
);
|
||||
}
|
||||
|
@ -252,7 +262,7 @@ class _SftpExplorerState extends State<SftpExplorer> {
|
|||
TextButton(
|
||||
onPressed: () async {
|
||||
try {
|
||||
await widget.sftpWorker.mkdir('${path}${nameController.text}');
|
||||
await widget.sftpWorker.mkdir('$path${nameController.text}');
|
||||
_listDir();
|
||||
}
|
||||
catch (e) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue