migrate flutter3.0

This commit is contained in:
Junyuan Feng
2022-05-12 15:06:48 +08:00
parent bfe7140a44
commit 282443a548
38 changed files with 184 additions and 140 deletions

View File

@@ -31,7 +31,7 @@ class _SFTPDownloadedPageState extends State<SFTPDownloadedPage> {
super.initState();
sftpDownloadDir.then((dir) {
_path = PathWithPrefix(dir.path);
_prefixPath = dir.path + '/';
_prefixPath = '${dir.path}/';
setState(() {});
});
}
@@ -58,8 +58,8 @@ class _SFTPDownloadedPageState extends State<SFTPDownloadedPage> {
],
),
body: FadeIn(
child: _buildBody(),
key: UniqueKey(),
child: _buildBody(),
),
bottomNavigationBar: SafeArea(
child: _buildPath(),

View File

@@ -122,6 +122,7 @@ class _SFTPPageState extends State<SFTPPage> {
} else {
return RefreshIndicator(
child: FadeIn(
key: Key(_status.spi!.name + _status.path!.path),
child: ListView.builder(
itemCount: _status.files!.length + 1,
controller: _scrollController,
@@ -155,7 +156,6 @@ class _SFTPPageState extends State<SFTPPage> {
);
},
),
key: Key(_status.spi!.name + _status.path!.path),
),
onRefresh: () => listDir(path: _status.path?.path));
}
@@ -277,7 +277,7 @@ class _SFTPPageState extends State<SFTPPage> {
return;
}
_status.client!
.mkdir(_status.path!.path + '/' + textController.text);
.mkdir('${_status.path!.path}/${textController.text}');
Navigator.of(context).pop();
listDir();
},
@@ -316,7 +316,7 @@ class _SFTPPageState extends State<SFTPPage> {
return;
}
(await _status.client!
.open(_status.path!.path + '/' + textController.text))
.open('${_status.path!.path}/${textController.text}'))
.writeBytes(Uint8List(0));
Navigator.of(context).pop();
listDir();