2022-08-12 20:07:16 +02:00
|
|
|
import 'package:github/github.dart';
|
2022-08-18 16:33:33 +02:00
|
|
|
import 'package:revanced_manager/constants.dart';
|
2022-08-12 20:07:16 +02:00
|
|
|
import 'package:revanced_manager/services/github_api.dart';
|
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
|
|
|
|
class ContributorsViewModel extends BaseViewModel {
|
2022-08-18 16:33:33 +02:00
|
|
|
final GithubAPI _githubAPI = GithubAPI();
|
2022-08-12 20:07:16 +02:00
|
|
|
List<Contributor> patchesContributors = [];
|
|
|
|
List<Contributor> integrationsContributors = [];
|
|
|
|
List<Contributor> patcherContributors = [];
|
|
|
|
List<Contributor> cliContributors = [];
|
|
|
|
List<Contributor> managerContributors = [];
|
|
|
|
|
2022-08-18 16:33:33 +02:00
|
|
|
Future<void> getContributors() async {
|
|
|
|
patchesContributors = await _githubAPI.getContributors(
|
|
|
|
ghOrg,
|
|
|
|
patchesRepo,
|
|
|
|
);
|
|
|
|
integrationsContributors = await _githubAPI.getContributors(
|
|
|
|
ghOrg,
|
|
|
|
integrationsRepo,
|
|
|
|
);
|
|
|
|
patcherContributors = await _githubAPI.getContributors(
|
|
|
|
ghOrg,
|
|
|
|
patcherRepo,
|
|
|
|
);
|
|
|
|
cliContributors = await _githubAPI.getContributors(
|
|
|
|
ghOrg,
|
|
|
|
cliRepo,
|
|
|
|
);
|
|
|
|
managerContributors = await _githubAPI.getContributors(
|
|
|
|
ghOrg,
|
|
|
|
managerRepo,
|
|
|
|
);
|
2022-08-26 03:01:53 +02:00
|
|
|
notifyListeners();
|
2022-08-12 20:07:16 +02:00
|
|
|
}
|
|
|
|
}
|