fix: Sorting of items in option dialog

fix: Translation of sizes
This commit is contained in:
PartyDonut 2025-02-07 16:56:50 +01:00
parent 2a5e2b4be1
commit 11189455ed
2 changed files with 7 additions and 1 deletions

View file

@ -26,7 +26,7 @@ List<Widget> buildClientSettingsAdvanced(BuildContext context, WidgetRef ref) {
contentPadding: EdgeInsets.zero,
value: selected,
onChanged: (value) => tap(),
title: Text(type.name),
title: Text(type.label(context)),
),
);
ref.read(homeSettingsProvider.notifier).setViewSize(newItems.toSet());

View file

@ -1,3 +1,5 @@
import 'dart:collection';
import 'package:flutter/material.dart';
Future<List<T>> openMultiSelectOptions<T>(
@ -40,6 +42,10 @@ Future<List<T>> openMultiSelectOptions<T>(
currentSelection = {item};
}
});
currentSelection = SplayTreeSet.of(
currentSelection,
(a, b) => items.indexOf(a).compareTo(items.indexOf(b)),
);
onChanged?.call(currentSelection.toList());
},
);