mirror of
https://github.com/ReVanced/revanced-manager.git
synced 2026-01-26 12:31:02 +00:00
feat: use default include property from patches
This commit is contained in:
@@ -3,11 +3,13 @@ class Patch {
|
||||
final String simpleName;
|
||||
final String version;
|
||||
final String description;
|
||||
final bool include;
|
||||
|
||||
Patch({
|
||||
required this.name,
|
||||
required this.simpleName,
|
||||
required this.version,
|
||||
required this.description,
|
||||
required this.include,
|
||||
});
|
||||
}
|
||||
|
||||
@@ -110,6 +110,7 @@ class PatcherAPI {
|
||||
.toTitleCase(),
|
||||
version: patch['version'] ?? '?.?.?',
|
||||
description: patch['description'] ?? 'N/A',
|
||||
include: patch['include'] ?? true,
|
||||
),
|
||||
);
|
||||
}
|
||||
@@ -150,6 +151,7 @@ class PatcherAPI {
|
||||
.toTitleCase(),
|
||||
version: patch['version'] ?? '?.?.?',
|
||||
description: patch['description'] ?? 'N/A',
|
||||
include: patch['include'] ?? true,
|
||||
),
|
||||
);
|
||||
}
|
||||
|
||||
@@ -9,7 +9,6 @@ import 'package:flutter_local_notifications/flutter_local_notifications.dart';
|
||||
import 'package:fluttertoast/fluttertoast.dart';
|
||||
import 'package:injectable/injectable.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/app/app.router.dart';
|
||||
import 'package:revanced_manager/main_viewmodel.dart';
|
||||
import 'package:revanced_manager/models/patched_application.dart';
|
||||
import 'package:revanced_manager/services/manager_api.dart';
|
||||
@@ -17,11 +16,9 @@ import 'package:revanced_manager/services/patcher_api.dart';
|
||||
import 'package:revanced_manager/ui/views/patcher/patcher_viewmodel.dart';
|
||||
import 'package:shared_preferences/shared_preferences.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
import 'package:stacked_services/stacked_services.dart';
|
||||
|
||||
@lazySingleton
|
||||
class HomeViewModel extends BaseViewModel {
|
||||
final NavigationService _navigationService = locator<NavigationService>();
|
||||
final ManagerAPI _managerAPI = ManagerAPI();
|
||||
final PatcherAPI _patcherAPI = locator<PatcherAPI>();
|
||||
final FlutterLocalNotificationsPlugin flutterLocalNotificationsPlugin =
|
||||
|
||||
@@ -14,6 +14,11 @@ class PatchesSelectorViewModel extends BaseViewModel {
|
||||
patches.addAll(await _patcherAPI.getFilteredPatches(
|
||||
locator<PatcherViewModel>().selectedApp,
|
||||
));
|
||||
for (Patch p in patches) {
|
||||
if (p.include) {
|
||||
selectedPatches.add(p);
|
||||
}
|
||||
}
|
||||
notifyListeners();
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user