mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
feat: Use ReVanced API v4
This commit is contained in:
@ -4,20 +4,10 @@ import 'package:stacked/stacked.dart';
|
||||
|
||||
class ContributorsViewModel extends BaseViewModel {
|
||||
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
||||
List<dynamic> patcherContributors = [];
|
||||
List<dynamic> patchesContributors = [];
|
||||
List<dynamic> cliContributors = [];
|
||||
List<dynamic> managerContributors = [];
|
||||
|
||||
String repoName(String repo) => repo.split('/').last;
|
||||
Map<String, List<dynamic>> contributors = {};
|
||||
|
||||
Future<void> getContributors() async {
|
||||
final Map<String, List<dynamic>> contributors =
|
||||
await _managerAPI.getContributors();
|
||||
patcherContributors = contributors[repoName(_managerAPI.defaultPatcherRepo)] ?? [];
|
||||
patchesContributors = contributors[repoName(_managerAPI.defaultPatchesRepo)] ?? [];
|
||||
cliContributors = contributors[repoName(_managerAPI.defaultCliRepo)] ?? [];
|
||||
managerContributors = contributors[repoName(_managerAPI.defaultManagerRepo)] ?? [];
|
||||
contributors = await _managerAPI.getContributors();
|
||||
notifyListeners();
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user