CPD/a1_aufgabenverwaltung/lib/components/status_display.dart

85 lines
2.6 KiB
Dart

import 'package:flutter/material.dart';
class StatusDisplay extends StatelessWidget {
final Color borderTextColor;
final Color backgroundColor;
final String icon;
final String text;
const StatusDisplay.done({super.key})
: borderTextColor = const Color(0xFF10B981),
backgroundColor = const Color(0xFF052E16),
icon = "✓",
text = "ERLEDIGT";
const StatusDisplay.ongoing({super.key})
: borderTextColor = const Color(0xFFF59E0B),
backgroundColor = const Color(0xFF1C1100),
icon = "◈",
text = "IN BEARBEITUNG";
const StatusDisplay.todo({super.key})
: borderTextColor = const Color(0xFF64748B),
backgroundColor = const Color(0xFF0F1117),
icon = "○",
text = "NICHT BEGONNEN";
@override
Widget build(BuildContext context) {
return Align(
alignment: Alignment.centerLeft,
child: Padding(
padding: const EdgeInsets.symmetric(vertical: 1.5),
child: Container(
height: 23,
decoration: BoxDecoration(
color: backgroundColor,
border: Border.all(
width: 1,
color: borderTextColor
)
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: Row(
mainAxisSize: MainAxisSize.min,
spacing: 4,
children: [
Padding(
// Nach den Werter aus Figma müsste es EdgeInsets.symmetric(vertical: 3)
// sein, aber damit sieht es auf der Website nicht zentriert aus
// deswegen habe ich das padding so angepasst, dass das icon auch auf
// auf der Website schön vertikal zentriert ist
padding: const EdgeInsets.only(top: 5, bottom: 3),
child: Text(
icon,
style: TextStyle(
color: borderTextColor,
fontWeight: FontWeight(600),
fontSize: 10,
letterSpacing: 0.55,
),
),
),
Padding(
padding: const EdgeInsets.symmetric(vertical: 2),
child: Text(
text,
style: TextStyle(
color: borderTextColor,
fontWeight: FontWeight(600),
fontSize: 11,
letterSpacing: 0.55,
),
),
)
],
),
),
),
),
);
}
}