mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 04:37:37 +02:00
feat: working app selector.
This commit is contained in:
@ -18,9 +18,9 @@ class _PatchesSelectorViewState extends State<PatchesSelectorView> {
|
||||
|
||||
@override
|
||||
Widget build(BuildContext context) {
|
||||
return ViewModelBuilder.reactive(
|
||||
return ViewModelBuilder<PatchesSelectorViewModel>.reactive(
|
||||
viewModelBuilder: () => PatchesSelectorViewModel(),
|
||||
builder: (context, PatchesSelectorViewModel model, child) => Scaffold(
|
||||
builder: (context, model, child) => Scaffold(
|
||||
body: Container(
|
||||
margin: const EdgeInsets.fromLTRB(6.0, 26.0, 6.0, 0),
|
||||
child: Column(
|
||||
|
@ -1,23 +1,21 @@
|
||||
import 'package:installed_apps/app_info.dart';
|
||||
import 'package:installed_apps/installed_apps.dart';
|
||||
import 'package:revanced_manager/app/app.locator.dart';
|
||||
import 'package:revanced_manager/models/patch.dart';
|
||||
import 'package:revanced_manager/services/patcher_api.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
class PatchesSelectorViewModel extends BaseViewModel {
|
||||
PatcherService patcherService = PatcherService();
|
||||
List<Patch>? patches = [];
|
||||
final PatcherService patcherService = locator<PatcherService>();
|
||||
AppInfo? appInfo;
|
||||
|
||||
Future<void> getApp() async {
|
||||
AppInfo app = await InstalledApps.getAppInfo("com.google.android.youtube");
|
||||
appInfo = app;
|
||||
}
|
||||
Future<List<Patch>?>? getPatches() async {
|
||||
|
||||
Future<List<Patch>?> getPatches() async {
|
||||
getApp();
|
||||
PatcherService patcherService = PatcherService();
|
||||
patcherService.loadPatches();
|
||||
return patcherService.getFilteredPatches(appInfo);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user