mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-11-01 05:53:27 +01:00
Save Search Preferences (#1226)
This commit is contained in:
@@ -604,11 +604,13 @@ class SelectionModal extends StatefulWidget {
|
||||
this.selectedByDefault = true,
|
||||
this.onlyOneSelectionAllowed = false,
|
||||
this.titlesAreLinks = true,
|
||||
this.title});
|
||||
this.title,
|
||||
this.deselectThese = const []});
|
||||
|
||||
String? title;
|
||||
Map<String, List<String>> entries;
|
||||
bool selectedByDefault;
|
||||
List<String> deselectThese;
|
||||
bool onlyOneSelectionAllowed;
|
||||
bool titlesAreLinks;
|
||||
|
||||
@@ -622,9 +624,13 @@ class _SelectionModalState extends State<SelectionModal> {
|
||||
@override
|
||||
void initState() {
|
||||
super.initState();
|
||||
for (var url in widget.entries.entries) {
|
||||
entrySelections.putIfAbsent(url,
|
||||
() => widget.selectedByDefault && !widget.onlyOneSelectionAllowed);
|
||||
for (var entry in widget.entries.entries) {
|
||||
entrySelections.putIfAbsent(
|
||||
entry,
|
||||
() =>
|
||||
widget.selectedByDefault &&
|
||||
!widget.onlyOneSelectionAllowed &&
|
||||
!widget.deselectThese.contains(entry.key));
|
||||
}
|
||||
if (widget.selectedByDefault && widget.onlyOneSelectionAllowed) {
|
||||
selectOnlyOne(widget.entries.entries.first.key);
|
||||
|
||||
Reference in New Issue
Block a user