File tree 1 file changed +5
-2
lines changed
1 file changed +5
-2
lines changed Original file line number Diff line number Diff line change @@ -230,7 +230,11 @@ class _FileManagerState extends State<FileManager> {
230
230
if (widget.controller.getCurrentPath.isNotEmpty) {
231
231
currentDir = Future .value ([widget.controller.getCurrentDirectory]);
232
232
} else {
233
- currentDir = FileManager .getStorageList ();
233
+ currentDir = Future (() async {
234
+ final list = await FileManager .getStorageList ();
235
+ widget.controller.setCurrentPath = list.first.path;
236
+ return [widget.controller.getCurrentDirectory];
237
+ });
234
238
}
235
239
}
236
240
@@ -254,7 +258,6 @@ class _FileManagerState extends State<FileManager> {
254
258
future: currentDir,
255
259
builder: (context, snapshot) {
256
260
if (snapshot.hasData) {
257
- widget.controller.setCurrentPath = snapshot.data! .first.path;
258
261
return _body (context);
259
262
} else if (snapshot.hasError) {
260
263
print (snapshot.error);
You can’t perform that action at this time.
0 commit comments