merged to origin/devlop

This commit is contained in:
2024-04-07 15:58:51 +02:00
185 changed files with 500 additions and 866 deletions

View File

@ -113,7 +113,7 @@ class _FilesState extends State<Files> {
@override
Widget build(BuildContext context) {
List<CacheableFile> files = data?.sortBy(
var files = data?.sortBy(
sortOption: currentSort,
foldersToTop: Provider.of<SettingsProvider>(context).val().fileSettings.sortFoldersToTop,
reversed: currentSortDirection
@ -131,8 +131,7 @@ class _FilesState extends State<Files> {
// ),
PopupMenuButton<bool>(
icon: Icon(currentSortDirection ? Icons.text_rotate_up : Icons.text_rotation_down),
itemBuilder: (context) {
return [true, false].map((e) => PopupMenuItem<bool>(
itemBuilder: (context) => [true, false].map((e) => PopupMenuItem<bool>(
value: e,
enabled: e != currentSortDirection,
child: Row(
@ -142,8 +141,7 @@ class _FilesState extends State<Files> {
Text(e ? 'Aufsteigend' : 'Absteigend')
],
)
)).toList();
},
)).toList(),
onSelected: (e) {
setState(() {
currentSortDirection = e;
@ -153,8 +151,7 @@ class _FilesState extends State<Files> {
),
PopupMenuButton<SortOption>(
icon: const Icon(Icons.sort),
itemBuilder: (context) {
return SortOptions.options.keys.map((key) => PopupMenuItem<SortOption>(
itemBuilder: (context) => SortOptions.options.keys.map((key) => PopupMenuItem<SortOption>(
value: key,
enabled: key != currentSort,
child: Row(
@ -164,8 +161,7 @@ class _FilesState extends State<Files> {
Text(SortOptions.getOption(key).displayName),
],
)
)).toList();
},
)).toList(),
onSelected: (e) {
setState(() {
currentSort = e;
@ -179,8 +175,7 @@ class _FilesState extends State<Files> {
heroTag: 'uploadFile',
backgroundColor: Theme.of(context).primaryColor,
onPressed: () {
showDialog(context: context, builder: (context) {
return SimpleDialog(
showDialog(context: context, builder: (context) => SimpleDialog(
children: [
ListTile(
leading: const Icon(Icons.create_new_folder_outlined),
@ -234,8 +229,7 @@ class _FilesState extends State<Files> {
),
),
],
);
});
));
},
child: const Icon(Icons.add),
),
@ -249,7 +243,7 @@ class _FilesState extends State<Files> {
padding: EdgeInsets.zero,
itemCount: files.length,
itemBuilder: (context, index) {
CacheableFile file = files.toList()[index];
var file = files.toList()[index];
return FileElement(file, widget.path, _query);
},
),