opt: entries empty fallback
Signed-off-by: Kingtous <kingtous@qq.com>
This commit is contained in:
parent
eea62352d2
commit
4bd5fe1509
@ -163,17 +163,22 @@ class _FileManagerPageState extends State<FileManagerPage>
|
||||
children: [
|
||||
Expanded(
|
||||
child: SingleChildScrollView(
|
||||
child: Obx(
|
||||
child: entries.isEmpty
|
||||
? Offstage()
|
||||
: Obx(
|
||||
() {
|
||||
final searchText =
|
||||
isLocal ? _searchTextLocal : _searchTextRemote;
|
||||
final filteredEntries = entries.where((element) {
|
||||
final filteredEntries = searchText.isEmpty
|
||||
? entries.where((element) {
|
||||
if (searchText.isEmpty) {
|
||||
return true;
|
||||
} else {
|
||||
return element.name.contains(searchText.value);
|
||||
return element.name
|
||||
.contains(searchText.value);
|
||||
}
|
||||
}).toList(growable: false);
|
||||
}).toList(growable: false)
|
||||
: entries;
|
||||
return DataTable(
|
||||
key: ValueKey(isLocal ? 0 : 1),
|
||||
showCheckboxColumn: true,
|
||||
@ -266,15 +271,17 @@ class _FileManagerPageState extends State<FileManagerPage>
|
||||
.replaceAll(".000", "") +
|
||||
" ",
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: MyTheme.darkGray),
|
||||
fontSize: 12,
|
||||
color: MyTheme.darkGray),
|
||||
)),
|
||||
DataCell(Text(
|
||||
sizeStr,
|
||||
style: TextStyle(
|
||||
fontSize: 12, color: MyTheme.darkGray),
|
||||
fontSize: 12,
|
||||
color: MyTheme.darkGray),
|
||||
)),
|
||||
]);
|
||||
}).toList(),
|
||||
}).toList(growable: false),
|
||||
);
|
||||
},
|
||||
),
|
||||
@ -753,16 +760,17 @@ class _FileManagerPageState extends State<FileManagerPage>
|
||||
}
|
||||
|
||||
Widget buildBread(bool isLocal) {
|
||||
final directory = model.getCurrentDir(isLocal);
|
||||
print(directory.path);
|
||||
return BreadCrumb(
|
||||
items: getPathBreadCrumbItems(isLocal, (list) {
|
||||
final items = getPathBreadCrumbItems(isLocal, (list) {
|
||||
var path = "";
|
||||
for (var item in list) {
|
||||
path = PathUtil.join(path, item, model.getCurrentIsWindows(isLocal));
|
||||
}
|
||||
openDirectory(path, isLocal: isLocal);
|
||||
}),
|
||||
});
|
||||
return items.isEmpty
|
||||
? Offstage()
|
||||
: BreadCrumb(
|
||||
items: items,
|
||||
divider: Text("/").paddingSymmetric(horizontal: 4.0),
|
||||
overflow: ScrollableOverflow(
|
||||
controller: getBreadCrumbScrollController(isLocal)),
|
||||
|
Loading…
x
Reference in New Issue
Block a user