Fixed sorting on files, removed some logging
This commit is contained in:
@ -1,5 +1,4 @@
|
||||
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
@ -100,12 +99,11 @@ class _FilesState extends State<Files> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
List<CacheableFile> files = (data?.files.toList() ?? List.empty())..sort((a, b) {
|
||||
int directorySort = Provider.of<SettingsProvider>(context).val().fileSettings.sortFoldersToTop ? a.isDirectory ? b.isDirectory ? 0 : 1 : -1 : 0;
|
||||
if(directorySort == 0) return SortOptions.getOption(currentSort).compare(a, b);
|
||||
return directorySort;
|
||||
});
|
||||
if(currentSortDirection) files = files.reversed.toList();
|
||||
List<CacheableFile> files = data?.sortBy(
|
||||
sortOption: currentSort,
|
||||
foldersToTop: Provider.of<SettingsProvider>(context).val().fileSettings.sortFoldersToTop,
|
||||
reversed: currentSortDirection
|
||||
) ?? List<CacheableFile>.empty();
|
||||
|
||||
return Scaffold(
|
||||
appBar: AppBar(
|
||||
@ -206,7 +204,6 @@ class _FilesState extends State<Files> {
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.documentPick().then((value) {
|
||||
log(value ?? "?");
|
||||
mediaUpload(value);
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
@ -218,7 +215,6 @@ class _FilesState extends State<Files> {
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.galleryPick().then((value) {
|
||||
log(value?.path ?? "?");
|
||||
mediaUpload(value?.path);
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
|
Reference in New Issue
Block a user