diff --git a/packages/neon/neon_files/lib/sort/files.dart b/packages/neon/neon_files/lib/sort/files.dart index d0d7d96e..b46bc14a 100644 --- a/packages/neon/neon_files/lib/sort/files.dart +++ b/packages/neon/neon_files/lib/sort/files.dart @@ -5,6 +5,7 @@ final filesSortBox = SortBox( FilesSortProperty.name: (final file) => file.name.toLowerCase(), FilesSortProperty.modifiedDate: (final file) => file.lastModified?.millisecondsSinceEpoch ?? 0, FilesSortProperty.size: (final file) => file.size ?? 0, + FilesSortProperty.isFolder: (final file) => file.isDirectory ? 0 : 1, }, { FilesSortProperty.modifiedDate: { diff --git a/packages/neon/neon_files/lib/widgets/browser_view.dart b/packages/neon/neon_files/lib/widgets/browser_view.dart index 7f066028..e05298a7 100644 --- a/packages/neon/neon_files/lib/widgets/browser_view.dart +++ b/packages/neon/neon_files/lib/widgets/browser_view.dart @@ -62,6 +62,9 @@ class _FilesBrowserViewState extends State { sortBox: filesSortBox, sortPropertyOption: widget.bloc.options.filesSortPropertyOption, sortBoxOrderOption: widget.bloc.options.filesSortBoxOrderOption, + presort: const { + (FilesSortProperty.isFolder, SortBoxOrder.ascending), + }, input: files.data, builder: (final context, final sorted) => NeonListView( scrollKey: 'files-${pathSnapshot.requireData.join('/')}',