add side panel and more build log controls

This commit is contained in:
2024-02-16 17:37:26 +01:00
committed by Lukas-Heiligenbrunner
parent 96c2876c97
commit 7ea241112c
5 changed files with 226 additions and 68 deletions

View File

@ -2,17 +2,18 @@ import 'package:flutter/material.dart';
import '../../constants/color_constants.dart';
class ChartCard extends StatelessWidget {
const ChartCard({
Key? key,
class SideCard extends StatelessWidget {
const SideCard({
super.key,
required this.title,
required this.color,
this.color,
required this.textRight,
required this.subtitle,
}) : super(key: key);
this.subtitle,
});
final Color color;
final String title, textRight, subtitle;
final Color? color;
final String title, textRight;
final String? subtitle;
@override
Widget build(BuildContext context) {
@ -27,12 +28,13 @@ class ChartCard extends StatelessWidget {
),
child: Row(
children: [
SizedBox(
height: 20,
width: 20,
child: Container(
color: color,
)),
if (color != null)
SizedBox(
height: 20,
width: 20,
child: Container(
color: color,
)),
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: defaultPadding),
@ -44,13 +46,14 @@ class ChartCard extends StatelessWidget {
maxLines: 1,
overflow: TextOverflow.ellipsis,
),
Text(
subtitle,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.white70),
),
if (subtitle != null)
Text(
subtitle!,
style: Theme.of(context)
.textTheme
.bodySmall!
.copyWith(color: Colors.white70),
),
],
),
),

View File

@ -39,21 +39,21 @@ class SidePanel extends StatelessWidget {
nrbuilds: nrbuilds,
nrfailedbuilds: nrfailedbuilds,
nrActiveBuilds: nrActiveBuilds),
ChartCard(
SideCard(
color: const Color(0xff0a7005),
title: "Successful Builds",
textRight:
"${((nrbuilds - nrfailedbuilds) * 100 / nrbuilds).toStringAsFixed(2)}%",
subtitle: (nrbuilds - nrfailedbuilds).toString(),
),
ChartCard(
SideCard(
color: const Color(0xff760707),
title: "Failed Builds",
textRight:
"${(nrfailedbuilds * 100 / nrbuilds).toStringAsFixed(2)}%",
subtitle: nrfailedbuilds.toString(),
),
ChartCard(
SideCard(
color: const Color(0xff9d8d00),
title: "Active Builds",
textRight: