assignment done

main
2wenty1ne 2026-11-14 18:24:03 +01:00
parent a8c5c989cb
commit c3d74aabbb
19 changed files with 549 additions and 147 deletions

View File

@ -0,0 +1,66 @@
import 'package:a1_aufgabenverwaltung/components/footer_element.dart';
import 'package:a1_aufgabenverwaltung/models/todo.dart';
import 'package:a1_aufgabenverwaltung/models/status.dart';
import 'package:flutter/material.dart';
class Footer extends StatelessWidget {
const Footer({super.key, required this.todos});
final List<Todo> todos;
static const backgroundColor = Color(0xFF0F1117);
static const borderColor = Color(0xFF1E2D3D);
static const doneColor = Color(0xFF10B981);
static const ongoingColor = Color(0xFFF59E0B);
static const todoColor = Color(0xFF64748B);
@override
Widget build(BuildContext context) {
var doneCounter = 0;
var ongoingCounter = 0;
var todoCounter = 0;
for (Todo todo in todos) {
switch (todo.status) {
case Status.done:
doneCounter = doneCounter + 1;
break;
case Status.ongoing:
ongoingCounter = ongoingCounter + 1;
break;
case Status.todo:
todoCounter = todoCounter + 1;
break;
}
}
String doneText = "✓ $doneCounter Erledigt";
String ongoingText = "◈ $ongoingCounter In Bearbeitung";
String todoText = "○ $todoCounter Nicht begonnen";
return Container(
height: 28,
decoration: BoxDecoration(
color: backgroundColor,
border: Border(
top: BorderSide(
color: borderColor,
width: 1,
)
)
),
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 6),
child: Row(
spacing: 16,
children: [
FooterElement(color: doneColor, text: doneText),
FooterElement(color: ongoingColor, text: ongoingText),
FooterElement(color: todoColor, text: todoText),
],
),
),
);
}
}

View File

@ -0,0 +1,20 @@
import 'package:flutter/material.dart';
class FooterElement extends StatelessWidget {
const FooterElement({super.key, required this.color, required this.text});
final Color color;
final String text;
@override
Widget build(BuildContext context) {
return Text(
text,
style: TextStyle(
color: color,
fontWeight: FontWeight(400),
fontSize: 10,
),
);
}
}

View File

@ -1,9 +1,10 @@
import 'package:a1_aufgabenverwaltung/models/todo.dart';
import 'package:flutter/material.dart';
class MainHeader extends StatelessWidget {
const MainHeader({super.key, required this.amountTodos});
const MainHeader({super.key, required this.todos});
final int amountTodos;
final List<Todo> todos;
static const backgroundColor = Color(0xFF0D1120);
static const borderColor = Color(0xFF1E2D3D);
@ -67,7 +68,7 @@ class MainHeader extends StatelessWidget {
),
Text(
"$amountTodos Aufgaben",
"${todos.length} Aufgaben",
style: TextStyle(
color: amountTodosColor,
fontWeight: FontWeight(400),

View File

@ -1,52 +0,0 @@
import 'package:a1_aufgabenverwaltung/models/status.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 = "s",
text = "ERLEDIGT";
const Statusdisplay.ongoing({super.key})
: borderTextColor = const Color(0xFFF59E0B),
backgroundColor = const Color(0xFF1C1100),
icon = "s",
text = "IN BEARBEITUNG";
const Statusdisplay.todo({super.key})
: borderTextColor = const Color(0xFF64748B),
backgroundColor = const Color(0xFF0F1117),
icon = "s",
text = "NICHT BEGONNEN";
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(vertical: 1.5),
child: Container(
height: 23,
decoration: BoxDecoration(
color: backgroundColor,
border: Border.all(
width: 1,
color: borderTextColor
)
),
child: Row(
children: [
Text(
text,
style: TextStyle(),
)
],
),
),
);
}
}

View File

@ -0,0 +1,84 @@
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,
),
),
)
],
),
),
),
),
);
}
}

View File

@ -1,10 +1,29 @@
import 'package:a1_aufgabenverwaltung/data/mock_todos.dart';
import 'package:a1_aufgabenverwaltung/models/todo.dart';
import 'package:flutter/material.dart';
import 'package:a1_aufgabenverwaltung/components/table_single_row.dart';
class Table extends StatelessWidget {
const Table({super.key});
const Table({super.key, required this.todos});
final List<Todo> todos;
static const backgroundColorEven = Color(0xFF0F1117);
static const backgroundColorOdd = Color(0xFF131720);
@override
Widget build(BuildContext context) {
return const Placeholder();
return ColoredBox(
color: backgroundColorEven,
child: SingleChildScrollView(
child: Column(
children: List.generate(mockTodos.length, (index) {
final backgroundColor = index.isEven ? backgroundColorEven : backgroundColorOdd;
final todo = mockTodos[index];
return TableSingleRow(todo: todo, index: index, backgroundColor: backgroundColor,);
}),
),
),
);
}
}

View File

@ -1,20 +1,12 @@
import 'package:a1_aufgabenverwaltung/components/table_header_element.dart';
import 'package:a1_aufgabenverwaltung/main.dart';
import 'package:flutter/material.dart';
class TableHeader extends StatelessWidget {
const TableHeader({
super.key,
required this.numberWidth,
required this.statusWidth,
required this.descriptionWidth,
required this.todoWidth,
});
final double numberWidth;
final double todoWidth;
final double statusWidth;
final double descriptionWidth;
static const backgroundColor = Color(0xFF0B0E16);
static const borderColor = Color(0xFF1E2D3D);
@ -31,20 +23,21 @@ class TableHeader extends StatelessWidget {
child: Row(
spacing: 12,
children: [
TableHeaderElement(text: "#", width: numberWidth),
TableHeaderElement(text: "#", width: Widths.numberWidth),
Expanded(
child: TableHeaderElement(text: "Aufgabe", width: todoWidth),
child: TableHeaderElement(text: "Aufgabe", width: Widths.titleWidth),
),
Expanded(
child: TableHeaderElement(text: "Status", width: statusWidth),
child: TableHeaderElement(text: "Status", width: Widths.statusWidth),
),
Expanded(
child: TableHeaderElement(
text: "Beschreibung",
width: descriptionWidth,
width: Widths.descriptionWidth,
),
),
SizedBox(width: 36),
SizedBox(width: 32),
],
),
),

View File

@ -1,19 +0,0 @@
import 'package:a1_aufgabenverwaltung/models/todo.dart';
import 'package:flutter/material.dart';
class TableRow extends StatelessWidget {
const TableRow({super.key, required this.todo});
final Todo todo;
@override
Widget build(BuildContext context) {
return Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
child: Row(spacing: 12, children: [
],
),
);
}
}

View File

@ -1,16 +1,33 @@
import 'package:flutter/material.dart';
class TableRowElement extends StatelessWidget {
const TableRowElement({super.key, required this.width});
const TableRowElement({super.key, required this.width, required this.text, required this.paddingVertical, required this.fontWeight, required this.fontSize, required this.textColor});
final double width;
final String text;
final double paddingVertical;
final FontWeight fontWeight;
final Color textColor;
final double fontSize;
static const double hight = 26;
static const Color primaryTextColor = Color(0xFFE2E8F0);
static const Color rowTextColor = Color(0xFF64748B);
@override
Widget build(BuildContext context) {
return SizedBox(width: width);
return SizedBox(
width: width,
child: Padding(
padding: EdgeInsets.symmetric(vertical: paddingVertical),
child: Text(
text,
style: TextStyle(
fontWeight: fontWeight,
color: textColor,
fontSize: fontSize,
),
),
),
);
}
}

View File

@ -0,0 +1,26 @@
import 'package:flutter/material.dart';
class TableRowNotTextElement extends StatelessWidget {
const TableRowNotTextElement({super.key, required this.width, required this.paddingVertical, required this.child});
final double width;
final double paddingVertical;
final Widget child;
static const double hight = 26;
@override
Widget build(BuildContext context) {
return SizedBox(
width: width,
child: Padding(
padding: EdgeInsets.symmetric(vertical: paddingVertical),
child: Align(
alignment: Alignment.centerLeft,
child: child
)
),
);
}
}

View File

@ -0,0 +1,93 @@
import 'package:a1_aufgabenverwaltung/components/status_display.dart';
import 'package:a1_aufgabenverwaltung/components/table_row_element.dart';
import 'package:a1_aufgabenverwaltung/components/table_row_not_text_element.dart';
import 'package:a1_aufgabenverwaltung/components/user_icon_element.dart';
import 'package:a1_aufgabenverwaltung/main.dart';
import 'package:a1_aufgabenverwaltung/models/status.dart';
import 'package:a1_aufgabenverwaltung/models/todo.dart';
import 'package:flutter/material.dart';
class TableSingleRow extends StatelessWidget {
const TableSingleRow({super.key, required this.todo, required this.index, required this.backgroundColor});
final Todo todo;
final int index;
final Color backgroundColor;
static const Color primaryTextColor = Color(0xFFE2E8F0);
static const Color secondaryTextColor = Color(0xFF64748B);
@override
Widget build(BuildContext context) {
final statusDisplay = switch (todo.status) {
Status.done => StatusDisplay.done(),
Status.ongoing => StatusDisplay.ongoing(),
Status.todo => StatusDisplay.todo()
};
final displayIndex = (index + 1).toString().padLeft(2, "0");
return ColoredBox(
color: backgroundColor,
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
child: Row(
spacing: 12,
children: [
TableRowElement(
width: Widths.numberWidth,
text: displayIndex,
paddingVertical: 5,
fontWeight: FontWeight(400),
textColor: secondaryTextColor,
fontSize: 11,
),
Expanded(
child: TableRowElement(
width: Widths.titleWidth,
text: todo.todoTitle,
paddingVertical: 4,
fontWeight: FontWeight(600),
fontSize: 12,
textColor: primaryTextColor,
),
),
Expanded(
child: TableRowNotTextElement(
width: Widths.statusWidth,
paddingVertical: 1.5,
child: statusDisplay
),
),
Expanded(
child: TableRowElement(
width: Widths.descriptionWidth,
text: todo.description,
paddingVertical: 5,
fontWeight: FontWeight(400),
fontSize: 11,
textColor: secondaryTextColor,
),
),
TableRowNotTextElement(
width: Widths.userInfoWidth,
paddingVertical: 0,
child: UserIconElement(
initials: todo.user.initials,
userColor: todo.user.userColor,
)
),
SizedBox(
width: Widths.rightSpaceWidth,
)
],
),
),
);
}
}

View File

@ -1,15 +1,11 @@
import 'package:a1_aufgabenverwaltung/components/title_bar_user_info.dart';
import 'package:a1_aufgabenverwaltung/models/header_infos.dart';
import 'package:flutter/material.dart';
class TitleBar extends StatelessWidget {
const TitleBar({super.key, required this.title, required this.smallTitle, required this.name, required this.initials, required this.userColor});
const TitleBar({super.key, required this.headerInfos, });
final String title;
final String smallTitle;
final String name;
final String initials;
final Color userColor;
final HeaderInfos headerInfos;
static const backgroundColor = Color(0xFF0D2B2B);
static const borderColor = Color(0xFF1A4A4A);
@ -42,7 +38,7 @@ class TitleBar extends StatelessWidget {
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
title.toUpperCase(),
headerInfos.title.toUpperCase(),
style: TextStyle(
color: titleColor,
fontWeight: FontWeight(700),
@ -51,7 +47,7 @@ class TitleBar extends StatelessWidget {
),
),
Text(
smallTitle,
headerInfos.smallTitle,
style: TextStyle(
color: smallTitleColor,
fontWeight: FontWeight(400),
@ -63,11 +59,7 @@ class TitleBar extends StatelessWidget {
),
),
TitleBarUserInfo(
name: name,
initials: initials,
userColor: userColor
)
TitleBarUserInfo(user: headerInfos.user)
],
),
),

View File

@ -1,12 +1,11 @@
import 'package:a1_aufgabenverwaltung/components/user_icon_element.dart';
import 'package:a1_aufgabenverwaltung/models/User.dart';
import 'package:flutter/material.dart';
class TitleBarUserInfo extends StatelessWidget {
const TitleBarUserInfo({super.key, required this.name, required this.initials, required this.userColor});
const TitleBarUserInfo({super.key, required this.user, });
final String name;
final String initials;
final Color userColor;
final User user;
static const signedInTextColor = Color(0xFF64748B);
static const usernameColor = Color(0xFFE2E8F0);
@ -26,11 +25,11 @@ class TitleBarUserInfo extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 8),
child: UserIconElement(initials: initials, userColor: userColor),
child: UserIconElement(initials: user.initials, userColor: user. userColor),
),
Text(
name,
user.fullName,
style: TextStyle(
color: usernameColor,
fontWeight: FontWeight(600),

View File

@ -0,0 +1,13 @@
import 'package:a1_aufgabenverwaltung/models/User.dart';
import 'package:a1_aufgabenverwaltung/models/header_infos.dart';
import 'package:flutter/material.dart';
const mockHeaderInfos = HeaderInfos(
title: "Aufgabenverwaltung",
smallTitle: "Team-Board / Sprint 7",
user: User(
fullName: "Anna Becker",
initials: "AB",
userColor: Color(0xFF3B82F6),
)
);

View File

@ -0,0 +1,128 @@
import 'package:a1_aufgabenverwaltung/models/User.dart';
import 'package:a1_aufgabenverwaltung/models/status.dart';
import 'package:a1_aufgabenverwaltung/models/todo.dart';
import 'package:flutter/material.dart';
const mockTodos = [
Todo(
todoTitle: "Backend-API dokumentieren",
status: Status.done,
description: "Swagger-Spezifikation für alle REST-Endpunkte erstellen",
user: User(
fullName: "Lili Mayer",
initials: "LM",
userColor: Color(0xFFE040FB)
),
),
Todo(
todoTitle: "Datenbankschema migrieren",
status: Status.ongoing,
description: "Schema v2.1 auf Produktionsserver anwenden und testen",
user: User(
fullName: "Anna Becker",
initials: "AB",
userColor: Color(0xFF3B82F6),
),
),
Todo(
todoTitle: "CI/CD-Pipeline einrichten",
status: Status.ongoing,
description: "GitHub Actions für automatische Deployments konfigurieren",
user: User(
fullName: "Sabine Kahn",
initials: "SK",
userColor: Color(0xFFF59E0B),
),
),
Todo(
todoTitle: "Sicherheitsaudit durchführen",
status: Status.todo,
description: "Penetrationstest und OWASP-Prüfung beauftragen",
user: User(
fullName: "Thomas Frank",
initials: "TF",
userColor: Color(0xFFA78BFA),
),
),
Todo(
todoTitle: "Nutzerhandbuch überarbeiten",
status: Status.todo,
description: "Onboarding-Dokumentation für Release 3.0 aktualisieren",
user: User(
fullName: "Lili Mayer",
initials: "LM",
userColor: Color(0xFFE040FB),
),
),
Todo(
todoTitle: "Performance-Benchmarks",
status: Status.done,
description: "Ladezeiten messen und Optimierungspotential identifizieren",
user: User(
fullName: "Sabine Kahn",
initials: "SK",
userColor: Color(0xFFF59E0B),
),
),
// AB HIER TEST
// Todo(
// todoTitle: "Backend-API dokumentieren",
// status: Status.done,
// description: "Swagger-Spezifikation für alle REST-Endpunkte erstellen",
// user: User(
// fullName: "Lili Mayer",
// initials: "LM",
// userColor: Color(0xFFE040FB)
// ),
// ),
// Todo(
// todoTitle: "Datenbankschema migrieren",
// status: Status.ongoing,
// description: "Schema v2.1 auf Produktionsserver anwenden und testen",
// user: User(
// fullName: "Anna Becker",
// initials: "AB",
// userColor: Color(0xFF3B82F6),
// ),
// ),
// Todo(
// todoTitle: "CI/CD-Pipeline einrichten",
// status: Status.ongoing,
// description: "GitHub Actions für automatische Deployments konfigurieren",
// user: User(
// fullName: "Sabine Kahn",
// initials: "SK",
// userColor: Color(0xFFF59E0B),
// ),
// ),
// Todo(
// todoTitle: "Sicherheitsaudit durchführen",
// status: Status.todo,
// description: "Penetrationstest und OWASP-Prüfung beauftragen",
// user: User(
// fullName: "Thomas Frank",
// initials: "TF",
// userColor: Color(0xFFA78BFA),
// ),
// ),
// Todo(
// todoTitle: "Nutzerhandbuch überarbeiten",
// status: Status.todo,
// description: "Onboarding-Dokumentation für Release 3.0 aktualisieren",
// user: User(
// fullName: "Lili Mayer",
// initials: "LM",
// userColor: Color(0xFFE040FB),
// ),
// ),
// Todo(
// todoTitle: "Performance-Benchmarks",
// status: Status.todo,
// description: "Ladezeiten messen und Optimierungspotential identifizieren",
// user: User(
// fullName: "Sabine Kahn",
// initials: "SK",
// userColor: Color(0xFFF59E0B),
// ),
// ),
];

View File

@ -1,45 +1,44 @@
import 'package:a1_aufgabenverwaltung/components/footer.dart';
import 'package:a1_aufgabenverwaltung/components/main_header.dart';
import 'package:a1_aufgabenverwaltung/components/table_header.dart';
import 'package:a1_aufgabenverwaltung/components/title_bar.dart';
import 'package:flutter/material.dart';
import 'package:a1_aufgabenverwaltung/components/table.dart';
import 'package:a1_aufgabenverwaltung/data/mock_title.dart';
import 'package:a1_aufgabenverwaltung/data/mock_todos.dart';
import 'package:flutter/material.dart' hide Table;
void main() {
runApp(const MainApp());
}
class Widths {
static const double numberWidth = 28;
static const double titleWidth = 240;
static const double statusWidth = 200;
static const double descriptionWidth = 493;
static const double userInfoWidth = 36;
static const double rightSpaceWidth = 32;
}
// Ich habe mich dazu entschieden die Spalten "Aufgabe", "Status" und "Beschreibung" expanded zu machen
// In meinen Augen sieht dadurch das resizen am schönsten aus
// Dadurch stimmt es aber nicht mehr mit den Werte im FIgma 100% überein
class MainApp extends StatelessWidget {
const MainApp({super.key});
static const double numberWidth = 28;
static const double todoWidth = 240;
static const double statusWidth = 200;
static const double descriptionWidth = 493;
@override
Widget build(BuildContext context) {
return const MaterialApp(
return MaterialApp(
home: Scaffold(
body: SingleChildScrollView(
child: Column(
children: [
TitleBar(
title: "Aufgabenverwaltung",
smallTitle: "Team-Board / Sprint 7",
name: "Anna Becker",
initials: "AB",
userColor: Color(0xFF3B82F6),
),
MainHeader(amountTodos: 6),
TableHeader(
numberWidth: numberWidth,
todoWidth: todoWidth,
statusWidth: statusWidth,
descriptionWidth: 20,
),
],
),
body: Column(
children: [
const TitleBar(headerInfos: mockHeaderInfos),
const MainHeader(todos: mockTodos),
const TableHeader(),
Expanded(child: const Table(todos: mockTodos)),
const Footer(todos: mockTodos),
],
),
),
);

View File

@ -0,0 +1,13 @@
import 'package:flutter/material.dart';
class User {
final String fullName;
final String initials;
final Color userColor;
const User({
required this.fullName,
required this.initials,
required this.userColor
});
}

View File

@ -0,0 +1,13 @@
import 'package:a1_aufgabenverwaltung/models/User.dart';
class HeaderInfos {
final String title;
final String smallTitle;
final User user;
const HeaderInfos({
required this.title,
required this.smallTitle,
required this.user
});
}

View File

@ -1,18 +1,15 @@
import 'package:a1_aufgabenverwaltung/models/User.dart';
import 'package:a1_aufgabenverwaltung/models/status.dart';
import 'package:flutter/services.dart';
class Todo {
final String todoTitle;
final Status status;
final String description;
final Color userColor;
final String initials;
final User user;
const Todo({
required this.todoTitle,
required this.status,
required this.description,
required this.userColor,
required this.initials,
required this.description, required this.user,
});
}