mirror of
https://github.com/ImranR98/Obtainium.git
synced 2025-08-19 13:09:30 +02:00
Merge branch 'main' into re7gog
This commit is contained in:
@@ -286,10 +286,14 @@ class AddAppPageState extends State<AddAppPage> {
|
||||
selectedByDefault: true,
|
||||
onlyOneSelectionAllowed: false,
|
||||
titlesAreLinks: false,
|
||||
deselectThese: settingsProvider.searchDeselected,
|
||||
);
|
||||
}) ??
|
||||
[];
|
||||
if (searchSources.isNotEmpty) {
|
||||
settingsProvider.searchDeselected = sourceStrings.keys
|
||||
.where((s) => !searchSources.contains(s))
|
||||
.toList();
|
||||
var results = await Future.wait(sourceProvider.sources
|
||||
.where((e) => searchSources.contains(e.name))
|
||||
.map((e) async {
|
||||
@@ -306,7 +310,6 @@ class AddAppPageState extends State<AddAppPage> {
|
||||
}
|
||||
}));
|
||||
|
||||
// .then((results) async {
|
||||
// Interleave results instead of simple reduce
|
||||
Map<String, List<String>> res = {};
|
||||
var si = 0;
|
||||
|
@@ -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);
|
||||
|
@@ -1,4 +1,3 @@
|
||||
import 'package:android_alarm_manager_plus/android_alarm_manager_plus.dart';
|
||||
import 'package:device_info_plus/device_info_plus.dart';
|
||||
import 'package:easy_localization/easy_localization.dart';
|
||||
import 'package:flutter/material.dart';
|
||||
@@ -619,38 +618,35 @@ class _SettingsPageState extends State<SettingsPage> {
|
||||
const Divider(
|
||||
height: 32,
|
||||
),
|
||||
Padding(
|
||||
padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
child: Column(children: [
|
||||
Row(
|
||||
mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
children: [
|
||||
Flexible(child: Text(tr('debugMenu'))),
|
||||
Switch(
|
||||
value: settingsProvider.showDebugOpts,
|
||||
onChanged: (value) {
|
||||
settingsProvider.showDebugOpts = value;
|
||||
})
|
||||
],
|
||||
),
|
||||
if (settingsProvider.showDebugOpts)
|
||||
Column(
|
||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
children: [
|
||||
height16,
|
||||
TextButton(
|
||||
onPressed: () {
|
||||
AndroidAlarmManager.oneShot(
|
||||
const Duration(seconds: 0),
|
||||
bgUpdateCheckAlarmId + 200,
|
||||
bgUpdateCheck);
|
||||
showMessage(tr('bgTaskStarted'), context);
|
||||
},
|
||||
child: Text(tr('runBgCheckNow')))
|
||||
],
|
||||
),
|
||||
]),
|
||||
),
|
||||
// Padding(
|
||||
// padding: const EdgeInsets.fromLTRB(16, 0, 16, 16),
|
||||
// child: Column(children: [
|
||||
// Row(
|
||||
// mainAxisAlignment: MainAxisAlignment.spaceBetween,
|
||||
// children: [
|
||||
// Flexible(child: Text(tr('debugMenu'))),
|
||||
// Switch(
|
||||
// value: settingsProvider.showDebugOpts,
|
||||
// onChanged: (value) {
|
||||
// settingsProvider.showDebugOpts = value;
|
||||
// })
|
||||
// ],
|
||||
// ),
|
||||
// if (settingsProvider.showDebugOpts)
|
||||
// Column(
|
||||
// crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||
// children: [
|
||||
// height16,
|
||||
// TextButton(
|
||||
// onPressed: () {
|
||||
// bgUpdateCheck('taskId', null);
|
||||
// showMessage(tr('bgTaskStarted'), context);
|
||||
// },
|
||||
// child: Text(tr('runBgCheckNow')))
|
||||
// ],
|
||||
// ),
|
||||
// ]),
|
||||
// ),
|
||||
],
|
||||
),
|
||||
)
|
||||
|
Reference in New Issue
Block a user