2023-12-30 15:46:13 +00:00
|
|
|
import 'dart:async';
|
|
|
|
|
|
|
|
import 'package:aurcache/api/builds.dart';
|
2023-12-30 21:23:42 +00:00
|
|
|
import 'package:aurcache/components/build_output.dart';
|
2023-12-30 15:46:13 +00:00
|
|
|
import 'package:aurcache/models/build.dart';
|
2024-01-01 16:11:05 +00:00
|
|
|
import 'package:aurcache/components/api/APIBuilder.dart';
|
2023-12-30 21:23:42 +00:00
|
|
|
import 'package:aurcache/providers/build_provider.dart';
|
2023-12-30 15:46:13 +00:00
|
|
|
import 'package:flutter/material.dart';
|
|
|
|
import 'package:go_router/go_router.dart';
|
|
|
|
|
|
|
|
import '../api/API.dart';
|
|
|
|
import '../components/dashboard/your_packages.dart';
|
|
|
|
|
|
|
|
class BuildScreen extends StatefulWidget {
|
|
|
|
const BuildScreen({super.key, required this.buildID});
|
|
|
|
|
|
|
|
final int buildID;
|
|
|
|
|
|
|
|
@override
|
|
|
|
State<BuildScreen> createState() => _BuildScreenState();
|
|
|
|
}
|
|
|
|
|
|
|
|
class _BuildScreenState extends State<BuildScreen> {
|
|
|
|
@override
|
|
|
|
Widget build(BuildContext context) {
|
|
|
|
return Scaffold(
|
2023-12-30 21:23:42 +00:00
|
|
|
body: APIBuilder<BuildProvider, Build, BuildDTO>(
|
|
|
|
dto: BuildDTO(buildID: widget.buildID),
|
|
|
|
interval: const Duration(seconds: 10),
|
|
|
|
onLoad: () => const Text("no data"),
|
|
|
|
onData: (buildData) {
|
|
|
|
return Column(
|
|
|
|
crossAxisAlignment: CrossAxisAlignment.start,
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
Row(
|
|
|
|
mainAxisAlignment: MainAxisAlignment.start,
|
|
|
|
children: [
|
|
|
|
const SizedBox(
|
|
|
|
width: 10,
|
|
|
|
),
|
|
|
|
IconButton(
|
|
|
|
icon: Icon(
|
|
|
|
switchSuccessIcon(buildData.status),
|
|
|
|
color: switchSuccessColor(buildData.status),
|
2023-12-30 15:46:13 +00:00
|
|
|
),
|
2023-12-30 21:23:42 +00:00
|
|
|
onPressed: () {
|
|
|
|
context.replace("/build/${buildData.id}");
|
|
|
|
},
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
width: 10,
|
|
|
|
),
|
|
|
|
Text(
|
|
|
|
buildData.pkg_name,
|
|
|
|
style: const TextStyle(fontWeight: FontWeight.bold),
|
2023-12-30 15:46:13 +00:00
|
|
|
),
|
2023-12-30 21:23:42 +00:00
|
|
|
const SizedBox(
|
|
|
|
width: 10,
|
|
|
|
),
|
|
|
|
const Text("triggered 2 months ago")
|
|
|
|
],
|
|
|
|
),
|
|
|
|
const SizedBox(
|
|
|
|
height: 15,
|
|
|
|
),
|
|
|
|
BuildOutput(build: buildData)
|
|
|
|
],
|
|
|
|
);
|
2023-12-30 15:46:13 +00:00
|
|
|
}),
|
|
|
|
appBar: AppBar(),
|
|
|
|
);
|
|
|
|
}
|
|
|
|
}
|