Fixed sorting on files, removed some logging
This commit is contained in:
@ -1,4 +1,3 @@
|
||||
import 'dart:developer';
|
||||
import 'dart:io';
|
||||
|
||||
import 'package:better_open_file/better_open_file.dart';
|
||||
@ -35,7 +34,7 @@ class FileElement extends StatefulWidget {
|
||||
progress: ProgressImplementation(),
|
||||
deleteOnCancel: true,
|
||||
onDone: () {
|
||||
//Future<OpenResult> result = OpenFile.open(local); // TODO legacy - refactor remove
|
||||
//Future<OpenResult> result = OpenFile.open(local); // TODO legacy - refactor: remove onDone parameter
|
||||
Navigator.of(context).push(MaterialPageRoute(builder: (context) => FileViewer(path: local)));
|
||||
onDone(OpenResult(message: "File viewer opened", type: ResultType.done));
|
||||
// result.then((value) => {
|
||||
@ -76,7 +75,9 @@ class _FileElementState extends State<FileElement> {
|
||||
],
|
||||
);
|
||||
}
|
||||
return widget.file.isDirectory ? Text("geändert ${Jiffy.parseFromDateTime(widget.file.modifiedAt ?? DateTime.now()).fromNow()}") : Text("${filesize(widget.file.size)}, ${Jiffy.parseFromDateTime(widget.file.modifiedAt ?? DateTime.now()).fromNow()}");
|
||||
return widget.file.isDirectory
|
||||
? Text("${widget.file.sort} geändert ${Jiffy.parseFromDateTime(widget.file.modifiedAt ?? DateTime.now()).fromNow()}")
|
||||
: Text("${widget.file.sort} ${filesize(widget.file.size)}, ${Jiffy.parseFromDateTime(widget.file.modifiedAt ?? DateTime.now()).fromNow()}");
|
||||
}
|
||||
|
||||
@override
|
||||
@ -125,8 +126,6 @@ class _FileElementState extends State<FileElement> {
|
||||
widget.file.currentlyDownloading = true;
|
||||
});
|
||||
|
||||
log("Download: ${widget.file.path} to ${widget.file.name}");
|
||||
|
||||
downloadCore = FileElement.download(context, widget.file.path, widget.file.name, (progress) {
|
||||
setState(() => percent = progress);
|
||||
}, (result) {
|
||||
|
@ -72,7 +72,6 @@ class _FileUploadDialogState extends State<FileUploadDialog> {
|
||||
);
|
||||
|
||||
cancelableOperation!.then((value) {
|
||||
log("Upload done!");
|
||||
setState(() {
|
||||
state = FileUploadState.done;
|
||||
});
|
||||
|
@ -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();
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:loader_overlay/loader_overlay.dart';
|
||||
@ -77,7 +76,6 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.documentPick().then((value) {
|
||||
log(value ?? "?");
|
||||
mediaUpload(value);
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
@ -89,7 +87,6 @@ class _ChatTextfieldState extends State<ChatTextfield> {
|
||||
onTap: () {
|
||||
context.loaderOverlay.show();
|
||||
FilePick.galleryPick().then((value) {
|
||||
log(value?.path ?? "?");
|
||||
mediaUpload(value?.path);
|
||||
});
|
||||
Navigator.of(context).pop();
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:async/async.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@ -80,7 +79,6 @@ class JoinChat extends SearchDelegate<String> {
|
||||
}
|
||||
);
|
||||
} else if(snapshot.hasError) {
|
||||
log(snapshot.error.toString());
|
||||
return PlaceholderView(icon: Icons.search_off, text: snapshot.error.toString());
|
||||
}
|
||||
|
||||
|
@ -1,4 +1,3 @@
|
||||
import 'dart:developer';
|
||||
|
||||
import 'package:flutter/material.dart';
|
||||
|
||||
@ -37,7 +36,6 @@ class _MessageReactionsState extends State<MessageReactions> {
|
||||
future: data,
|
||||
builder: (context, snapshot) {
|
||||
if(snapshot.data == null) return const LoadingSpinner();
|
||||
log(snapshot.data!.toJson().toString());
|
||||
return ListView(
|
||||
children: [
|
||||
...snapshot.data!.data.entries.map<Widget>((entry) {
|
||||
@ -48,7 +46,7 @@ class _MessageReactionsState extends State<MessageReactions> {
|
||||
collapsedIconColor: Theme.of(context).colorScheme.onSurface,
|
||||
|
||||
subtitle: const Text("Tippe für mehr"),
|
||||
leading: Text(entry.key),
|
||||
leading: CenteredLeading(Text(entry.key)),
|
||||
title: Text("${entry.value.length} mal reagiert"),
|
||||
children: entry.value.map((e) {
|
||||
bool isSelf = AccountData().getUsername() == e.actorId;
|
||||
|
Reference in New Issue
Block a user