mirror of
https://github.com/revanced/revanced-manager.git
synced 2025-06-12 12:47:37 +02:00
fix: code refactoring (#5)
This commit is contained in:
@ -1,27 +1,36 @@
|
||||
import 'package:github/github.dart';
|
||||
import 'package:revanced_manager/constants.dart';
|
||||
import 'package:revanced_manager/services/github_api.dart';
|
||||
import 'package:stacked/stacked.dart';
|
||||
|
||||
class ContributorsViewModel extends BaseViewModel {
|
||||
final GithubAPI githubAPI = GithubAPI();
|
||||
final GithubAPI _githubAPI = GithubAPI();
|
||||
List<Contributor> patchesContributors = [];
|
||||
List<Contributor> integrationsContributors = [];
|
||||
List<Contributor> patcherContributors = [];
|
||||
List<Contributor> cliContributors = [];
|
||||
List<Contributor> managerContributors = [];
|
||||
|
||||
Future<List<Contributor>> getContributors() async {
|
||||
patchesContributors =
|
||||
await githubAPI.getContributors('revanced', 'revanced-patches');
|
||||
integrationsContributors =
|
||||
await githubAPI.getContributors('revanced', 'revanced-integrations');
|
||||
patcherContributors =
|
||||
await githubAPI.getContributors('revanced', 'revanced-patcher');
|
||||
cliContributors =
|
||||
await githubAPI.getContributors('revanced', 'revanced-cli');
|
||||
managerContributors =
|
||||
await githubAPI.getContributors('revanced', 'revanced-manager');
|
||||
|
||||
return [];
|
||||
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,
|
||||
);
|
||||
}
|
||||
}
|
||||
|
Reference in New Issue
Block a user