aurcache/frontend/lib/providers/builds_provider.dart
2024-02-11 23:05:39 +01:00

25 lines
514 B
Dart

import 'package:aurcache/api/builds.dart';
import '../api/API.dart';
import '../models/build.dart';
import 'BaseProvider.dart';
class BuildsDTO {
final int? pkgID;
final int? limit;
BuildsDTO({this.pkgID, this.limit});
}
class BuildsProvider extends BaseProvider<List<Build>, BuildsDTO> {
@override
loadFuture(context, {dto}) {
if (dto != null) {
data = API.listAllBuilds(pkgID: dto.pkgID, limit: dto.limit);
this.dto = dto;
} else {
data = API.listAllBuilds();
}
}
}