From c3d74aabbb764f4d30b619996b8de76b3c35060a Mon Sep 17 00:00:00 2001 From: 2wenty1ne Date: Sat, 14 Nov 2026 18:24:03 +0100 Subject: [PATCH] assignment done --- .../lib/components/footer.dart | 66 +++++++++ .../lib/components/footer_element.dart | 20 +++ .../lib/components/main_header.dart | 7 +- .../lib/components/statusDisplay.dart | 52 ------- .../lib/components/status_display.dart | 84 ++++++++++++ .../lib/components/table.dart | 23 +++- .../lib/components/table_header.dart | 19 +-- .../lib/components/table_row.dart | 19 --- .../lib/components/table_row_element.dart | 25 +++- .../table_row_not_text_element.dart | 26 ++++ .../lib/components/table_single_row.dart | 93 +++++++++++++ .../lib/components/title_bar.dart | 20 +-- .../lib/components/title_bar_user_info.dart | 11 +- .../lib/data/mock_title.dart | 13 ++ .../lib/data/mock_todos.dart | 128 ++++++++++++++++++ a1_aufgabenverwaltung/lib/main.dart | 55 ++++---- a1_aufgabenverwaltung/lib/models/User.dart | 13 ++ .../lib/models/header_infos.dart | 13 ++ a1_aufgabenverwaltung/lib/models/todo.dart | 9 +- 19 files changed, 549 insertions(+), 147 deletions(-) create mode 100644 a1_aufgabenverwaltung/lib/components/footer.dart create mode 100644 a1_aufgabenverwaltung/lib/components/footer_element.dart delete mode 100644 a1_aufgabenverwaltung/lib/components/statusDisplay.dart create mode 100644 a1_aufgabenverwaltung/lib/components/status_display.dart delete mode 100644 a1_aufgabenverwaltung/lib/components/table_row.dart create mode 100644 a1_aufgabenverwaltung/lib/components/table_row_not_text_element.dart create mode 100644 a1_aufgabenverwaltung/lib/components/table_single_row.dart create mode 100644 a1_aufgabenverwaltung/lib/data/mock_title.dart create mode 100644 a1_aufgabenverwaltung/lib/data/mock_todos.dart create mode 100644 a1_aufgabenverwaltung/lib/models/User.dart create mode 100644 a1_aufgabenverwaltung/lib/models/header_infos.dart diff --git a/a1_aufgabenverwaltung/lib/components/footer.dart b/a1_aufgabenverwaltung/lib/components/footer.dart new file mode 100644 index 0000000..8d17016 --- /dev/null +++ b/a1_aufgabenverwaltung/lib/components/footer.dart @@ -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 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), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/components/footer_element.dart b/a1_aufgabenverwaltung/lib/components/footer_element.dart new file mode 100644 index 0000000..ffa4d6e --- /dev/null +++ b/a1_aufgabenverwaltung/lib/components/footer_element.dart @@ -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, + ), + ); + } +} \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/components/main_header.dart b/a1_aufgabenverwaltung/lib/components/main_header.dart index 6c573ee..d98cdaa 100644 --- a/a1_aufgabenverwaltung/lib/components/main_header.dart +++ b/a1_aufgabenverwaltung/lib/components/main_header.dart @@ -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 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), diff --git a/a1_aufgabenverwaltung/lib/components/statusDisplay.dart b/a1_aufgabenverwaltung/lib/components/statusDisplay.dart deleted file mode 100644 index 8079146..0000000 --- a/a1_aufgabenverwaltung/lib/components/statusDisplay.dart +++ /dev/null @@ -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(), - ) - ], - ), - ), - ); - } -} diff --git a/a1_aufgabenverwaltung/lib/components/status_display.dart b/a1_aufgabenverwaltung/lib/components/status_display.dart new file mode 100644 index 0000000..be0cb59 --- /dev/null +++ b/a1_aufgabenverwaltung/lib/components/status_display.dart @@ -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, + ), + ), + ) + ], + ), + ), + ), + ), + ); + } +} diff --git a/a1_aufgabenverwaltung/lib/components/table.dart b/a1_aufgabenverwaltung/lib/components/table.dart index 5f542c5..bc9cba1 100644 --- a/a1_aufgabenverwaltung/lib/components/table.dart +++ b/a1_aufgabenverwaltung/lib/components/table.dart @@ -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 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,); + }), + ), + ), + ); } } \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/components/table_header.dart b/a1_aufgabenverwaltung/lib/components/table_header.dart index 1d30440..46770cd 100644 --- a/a1_aufgabenverwaltung/lib/components/table_header.dart +++ b/a1_aufgabenverwaltung/lib/components/table_header.dart @@ -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), ], ), ), diff --git a/a1_aufgabenverwaltung/lib/components/table_row.dart b/a1_aufgabenverwaltung/lib/components/table_row.dart deleted file mode 100644 index 307a536..0000000 --- a/a1_aufgabenverwaltung/lib/components/table_row.dart +++ /dev/null @@ -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: [ - - ], - ), - ); - } -} diff --git a/a1_aufgabenverwaltung/lib/components/table_row_element.dart b/a1_aufgabenverwaltung/lib/components/table_row_element.dart index dc040e8..7f7c15f 100644 --- a/a1_aufgabenverwaltung/lib/components/table_row_element.dart +++ b/a1_aufgabenverwaltung/lib/components/table_row_element.dart @@ -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, + ), + ), + ), + ); } } diff --git a/a1_aufgabenverwaltung/lib/components/table_row_not_text_element.dart b/a1_aufgabenverwaltung/lib/components/table_row_not_text_element.dart new file mode 100644 index 0000000..8efc32e --- /dev/null +++ b/a1_aufgabenverwaltung/lib/components/table_row_not_text_element.dart @@ -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 + ) + ), + ); + } +} \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/components/table_single_row.dart b/a1_aufgabenverwaltung/lib/components/table_single_row.dart new file mode 100644 index 0000000..15d300f --- /dev/null +++ b/a1_aufgabenverwaltung/lib/components/table_single_row.dart @@ -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, + ) + ], + ), + ), + ); + } +} diff --git a/a1_aufgabenverwaltung/lib/components/title_bar.dart b/a1_aufgabenverwaltung/lib/components/title_bar.dart index 02ba5d5..8343034 100644 --- a/a1_aufgabenverwaltung/lib/components/title_bar.dart +++ b/a1_aufgabenverwaltung/lib/components/title_bar.dart @@ -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) ], ), ), diff --git a/a1_aufgabenverwaltung/lib/components/title_bar_user_info.dart b/a1_aufgabenverwaltung/lib/components/title_bar_user_info.dart index a676656..03e0d98 100644 --- a/a1_aufgabenverwaltung/lib/components/title_bar_user_info.dart +++ b/a1_aufgabenverwaltung/lib/components/title_bar_user_info.dart @@ -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), diff --git a/a1_aufgabenverwaltung/lib/data/mock_title.dart b/a1_aufgabenverwaltung/lib/data/mock_title.dart new file mode 100644 index 0000000..e2de57b --- /dev/null +++ b/a1_aufgabenverwaltung/lib/data/mock_title.dart @@ -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), + ) +); \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/data/mock_todos.dart b/a1_aufgabenverwaltung/lib/data/mock_todos.dart new file mode 100644 index 0000000..85c008a --- /dev/null +++ b/a1_aufgabenverwaltung/lib/data/mock_todos.dart @@ -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), + // ), + // ), +]; \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/main.dart b/a1_aufgabenverwaltung/lib/main.dart index 44f21e5..f5099ba 100644 --- a/a1_aufgabenverwaltung/lib/main.dart +++ b/a1_aufgabenverwaltung/lib/main.dart @@ -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), + ], ), ), ); diff --git a/a1_aufgabenverwaltung/lib/models/User.dart b/a1_aufgabenverwaltung/lib/models/User.dart new file mode 100644 index 0000000..f9857c8 --- /dev/null +++ b/a1_aufgabenverwaltung/lib/models/User.dart @@ -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 + }); +} \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/models/header_infos.dart b/a1_aufgabenverwaltung/lib/models/header_infos.dart new file mode 100644 index 0000000..c71ef11 --- /dev/null +++ b/a1_aufgabenverwaltung/lib/models/header_infos.dart @@ -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 + }); +} \ No newline at end of file diff --git a/a1_aufgabenverwaltung/lib/models/todo.dart b/a1_aufgabenverwaltung/lib/models/todo.dart index d817983..9848e6b 100644 --- a/a1_aufgabenverwaltung/lib/models/todo.dart +++ b/a1_aufgabenverwaltung/lib/models/todo.dart @@ -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, }); }