import 'package:revanced_manager/app/app.locator.dart'; import 'package:revanced_manager/services/manager_api.dart'; import 'package:stacked/stacked.dart'; class ContributorsViewModel extends BaseViewModel { final ManagerAPI _managerAPI = locator(); List patcherContributors = []; List patchesContributors = []; List cliContributors = []; List managerContributors = []; String repoName(String repo) => repo.split('/').last; Future getContributors() async { final Map> contributors = await _managerAPI.getContributors(); patcherContributors = contributors[repoName(_managerAPI.defaultPatcherRepo)] ?? []; patchesContributors = contributors[repoName(_managerAPI.defaultPatchesRepo)] ?? []; cliContributors = contributors[repoName(_managerAPI.defaultCliRepo)] ?? []; managerContributors = contributors[repoName(_managerAPI.defaultManagerRepo)] ?? []; notifyListeners(); } }