remove builds from db if pkg is deleted

fix apibuilder interval refreshes refreshing widgets not visible
This commit is contained in:
2024-01-01 17:11:05 +01:00
parent fca5df4c70
commit 02fda58db4
15 changed files with 110 additions and 68 deletions

View File

@ -4,7 +4,7 @@ import 'package:aurcache/api/builds.dart';
import 'package:aurcache/components/builds_table.dart';
import 'package:aurcache/models/build.dart';
import 'package:aurcache/components/dashboard/your_packages.dart';
import 'package:aurcache/providers/APIBuilder.dart';
import 'package:aurcache/components/api/APIBuilder.dart';
import 'package:aurcache/providers/builds_provider.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
@ -41,6 +41,7 @@ class _RecentBuildsState extends State<RecentBuilds> {
SizedBox(
width: double.infinity,
child: APIBuilder<BuildsProvider, List<Build>, BuildsDTO>(
key: const Key("Builds on dashboard"),
dto: BuildsDTO(limit: 10),
interval: const Duration(seconds: 10),
onLoad: () => const Text("no data"),

View File

@ -1,7 +1,7 @@
import 'dart:async';
import 'package:aurcache/api/packages.dart';
import 'package:aurcache/providers/APIBuilder.dart';
import 'package:aurcache/components/api/APIBuilder.dart';
import 'package:aurcache/providers/packages_provider.dart';
import 'package:flutter/material.dart';
import 'package:go_router/go_router.dart';
@ -44,7 +44,7 @@ class _YourPackagesState extends State<YourPackages> {
child: SizedBox(
width: double.infinity,
child: APIBuilder<PackagesProvider, List<Package>, Object>(
key: GlobalKey(),
key: Key("Packages on dashboard"),
interval: const Duration(seconds: 10),
onData: (data) {
return DataTable(