Skip to content

Commit 7415701

Browse files
author
Arpit-Sahu
committed
sort controller added
1 parent 631fdb5 commit 7415701

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

lib/controller/file_manager_controller.dart

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,14 @@ class FileManagerController extends ChangeNotifier {
3131
return willNotGoToParent;
3232
}
3333

34+
List<FileSystemEntity> sort(SortBy sort, List<FileSystemEntity> entitys) {
35+
if (sort == SortBy.name) {
36+
entitys
37+
.sort((a, b) => a.path.toLowerCase().compareTo(b.path.toLowerCase()));
38+
return entitys;
39+
} else if (sort == SortBy.date) {}
40+
}
41+
3442
/// Open directory by providing Directory.
3543
void openDirectory(FileSystemEntity entity) {
3644
if (entity is Directory) {

0 commit comments

Comments
 (0)