revanced-manager/lib/ui/views/contributors/contributors_viewmodel.dart

37 lines
1 KiB
Dart
Raw Normal View History

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-12 20:07:16 +02:00
}
}