2022-09-07 03:37:25 +02:00
|
|
|
import 'package:revanced_manager/app/app.locator.dart';
|
|
|
|
import 'package:revanced_manager/services/manager_api.dart';
|
2022-08-12 20:07:16 +02:00
|
|
|
import 'package:stacked/stacked.dart';
|
|
|
|
|
|
|
|
class ContributorsViewModel extends BaseViewModel {
|
2022-09-07 03:37:25 +02:00
|
|
|
final ManagerAPI _managerAPI = locator<ManagerAPI>();
|
2022-09-11 03:01:06 +02:00
|
|
|
List<dynamic> patcherContributors = [];
|
|
|
|
List<dynamic> patchesContributors = [];
|
|
|
|
List<dynamic> integrationsContributors = [];
|
|
|
|
List<dynamic> cliContributors = [];
|
|
|
|
List<dynamic> managerContributors = [];
|
2022-08-12 20:07:16 +02:00
|
|
|
|
2022-08-18 16:33:33 +02:00
|
|
|
Future<void> getContributors() async {
|
2023-01-30 13:35:06 +01:00
|
|
|
final Map<String, List<dynamic>> contributors =
|
2022-09-11 03:01:06 +02:00
|
|
|
await _managerAPI.getContributors();
|
|
|
|
patcherContributors = contributors[_managerAPI.defaultPatcherRepo] ?? [];
|
2024-02-19 15:41:42 +01:00
|
|
|
patchesContributors = contributors[_managerAPI.defaultPatchesRepo] ?? [];
|
2022-09-11 03:01:06 +02:00
|
|
|
integrationsContributors =
|
2024-02-19 15:41:42 +01:00
|
|
|
contributors[_managerAPI.defaultIntegrationsRepo] ?? [];
|
2022-09-11 03:01:06 +02:00
|
|
|
cliContributors = contributors[_managerAPI.defaultCliRepo] ?? [];
|
|
|
|
managerContributors = contributors[_managerAPI.defaultManagerRepo] ?? [];
|
2022-08-26 03:01:53 +02:00
|
|
|
notifyListeners();
|
2022-08-12 20:07:16 +02:00
|
|
|
}
|
|
|
|
}
|