added table header + some work on the table

main
Ioana P. 2026-11-14 16:57:07 +01:00
parent 6799c4f948
commit 7064f68229
9 changed files with 200 additions and 30 deletions

View File

@ -0,0 +1,40 @@
import '../models/task.dart';
const sampleTasks = [
Task(
title: 'Backend-API dokumentieren',
description: 'Swagger-Spezifikation für alle REST-Endpunkte erstellen',
status: TaskStatus.erledigt,
initials: 'LM',
),
Task(
title: 'Datenbankschema migrieren',
description: 'Schema v2.1 auf Produktionsserver anwenden und testen',
status: TaskStatus.inBearbeitung,
initials: 'AB',
),
Task(
title: 'CI/CD-Pipeline einrichten',
description: 'GitHub Actions für automatische Deployments konfigurieren',
status: TaskStatus.inBearbeitung,
initials: 'SK',
),
Task(
title: 'Sicherheitsaudit durchführen',
description: 'Penetrationstest und OWASP-Prüfung beauftragen',
status: TaskStatus.nichtBegonnen,
initials: 'TF',
),
Task(
title: 'Nutzerhandbuch überarbeiten',
description: 'Onboarding-Dokumentation für Release 3.0 aktualisieren',
status: TaskStatus.nichtBegonnen,
initials: 'LM',
),
Task(
title: 'Performance-Benchmarks',
description: 'Ladezeiten messen und Optimierungspotenzial identifizieren',
status: TaskStatus.erledigt,
initials: 'SK',
),
];

View File

@ -1,6 +1,8 @@
import 'package:flutter/material.dart';
import 'widgets/app_header.dart';
import 'widgets/toolbar.dart';
import 'widgets/table_header.dart';
import 'widgets/task_list.dart';
void main() {
runApp(const MainApp());
@ -25,12 +27,8 @@ class MainApp extends StatelessWidget {
children: [
AppHeader(), // 1. Header
Toolbar(), // 2. Toolbar
// 3. Table header
Expanded(
child: Container(
color: Color(0xFF0F1117),
), // 4. Task rows
),
TableHeader(), // 3. Table header
Expanded(child: TaskList()),
// 5. Footer
],
),

View File

@ -0,0 +1,15 @@
enum TaskStatus { erledigt, inBearbeitung, nichtBegonnen }
class Task {
final String title;
final String description;
final TaskStatus status;
final String initials;
const Task({
required this.title,
required this.description,
required this.status,
required this.initials,
});
}

View File

@ -1,5 +1,4 @@
import 'package:flutter/material.dart';
import 'avatar_badge.dart';
class AppHeader extends StatelessWidget {
@ -16,59 +15,55 @@ class AppHeader extends StatelessWidget {
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 12),
child: Row(
mainAxisAlignment: MainAxisAlignment.spaceBetween,
children: const [
children: [
Column(
spacing: 2,
crossAxisAlignment: CrossAxisAlignment.start,
children: [
Text(
'AUFGABENVERWALTUNG',
style: TextStyle(
fontFamily: 'Roboto',
fontSize: 13,
fontWeight: FontWeight.w700,
height: 1.5,
letterSpacing: 1.56,
height: 20 / 13,
color: Color(0xFF5EEAD4),
),
),
SizedBox(height: 2),
Text(
'Team-Board / Sprint 7',
style: TextStyle(
fontFamily: 'Roboto',
fontSize: 10,
height: 1.5,
color: Color(0xFF2D7A7A),
),
),
],
), // Container: title + breadcrumb
),
Row(
spacing: 8,
mainAxisSize: MainAxisSize.min,
children: [
Text(
'Angemeldet als',
style: TextStyle(
fontFamily: 'Roboto',
fontSize: 11,
height: 1.5,
height: 17 / 11,
color: Color(0xFF64748B),
),
),
SizedBox(width: 8),
AvatarBadge(initials: 'AB', color: Color(0xFF3B82F6)),
SizedBox(width: 8),
AvatarBadge(initials: 'AB', color: Color(0xFF3B82F6), size: 24),
Text(
'Anna Becker',
style: TextStyle(
fontSize: 11,
fontWeight: FontWeight.w600,
height: 1.5,
height: 17 / 11,
color: Color(0xFFE2E8F0),
),
),
],
), // Container: Angemeldet als + avatar + name
),
],
),
),
@ -77,4 +72,4 @@ class AppHeader extends StatelessWidget {
),
);
}
}
}

View File

@ -3,14 +3,20 @@ import 'package:flutter/material.dart';
class AvatarBadge extends StatelessWidget {
final String initials;
final Color color;
final double size;
const AvatarBadge({super.key, required this.initials, required this.color});
const AvatarBadge({
super.key,
required this.initials,
required this.color,
this.size = 24,
});
@override
Widget build(BuildContext context) {
return Container(
width: 24,
height: 24,
width: size,
height: size,
padding: const EdgeInsets.all(1),
decoration: BoxDecoration(
color: color,
@ -25,11 +31,10 @@ class AvatarBadge extends StatelessWidget {
child: Text(
initials,
style: TextStyle(
color: color,
fontFamily: 'Roboto',
fontSize: 10,
fontWeight: FontWeight.w700,
letterSpacing: 0,
height: 1.5,
color: color,
),
),
),

View File

@ -0,0 +1,49 @@
import 'package:flutter/material.dart';
const headerStyle = TextStyle(
fontFamily: 'Roboto',
fontSize: 10,
fontWeight: FontWeight.w600,
height: 1.5,
letterSpacing: 1,
color: Color(0xFF64748B),
);
class TableHeader extends StatelessWidget {
const TableHeader({super.key});
@override
Widget build(BuildContext context) {
return Container(
height: 32,
color: const Color(0xFF0B0E16),
child: Column(
children: [
Expanded(
child: Padding(
padding: const EdgeInsets.symmetric(horizontal: 20),
child: Row(
spacing: 12,
children: [
SizedBox(width: 28, child: Text('#', style: headerStyle)),
SizedBox(
width: 240,
child: Text('AUFGABE', style: headerStyle),
),
SizedBox(
width: 200,
child: Text('STATUS', style: headerStyle),
),
Expanded(child: Text('BESCHREIBUNG', style: headerStyle)),
SizedBox(width: 36, height:15),
SizedBox(width: 32, height:15),
],
),
),
),
Container(height: 1, color: const Color(0xFF1E2D3D)),
],
),
);
}
}

View File

@ -0,0 +1,17 @@
import 'package:flutter/material.dart';
import '../data/sample_tasks.dart';
import 'task_row.dart';
class TaskList extends StatelessWidget {
const TaskList({super.key});
@override
Widget build(BuildContext context) {
return ListView.builder(
itemCount: sampleTasks.length,
itemBuilder: (context, index) {
return TaskRow(task: sampleTasks[index], number: index + 1);
},
);
}
}

View File

@ -0,0 +1,51 @@
import 'package:flutter/material.dart';
import 'avatar_badge.dart';
import '../models/task.dart';
class TaskRow extends StatelessWidget {
final Task task;
final int number;
const TaskRow({super.key, required this.task, required this.number});
@override
Widget build(BuildContext context) {
return Container(
height: 51,
color: number.isOdd ? const Color(0xFF0F1117) : const Color(0xFF131720),
padding: const EdgeInsets.fromLTRB(22, 0, 20, 1),
child: Row(
spacing: 12,
children: [
SizedBox(width: 28, child: Text(number.toString().padLeft(2, '0'))),
SizedBox(width: 240, child: Text(task.title)),
SizedBox(width: 200, child: Text(task.status.name)), // TODO: badge
Expanded(
child: Text(
task.description,
style: TextStyle(
fontWeight: FontWeight.w400,
fontSize: 11,
height: 17 / 11,
color: Color(0xFF64748B),
),
),
),
SizedBox(
width: 36,
child: Align(
alignment: Alignment.centerLeft,
child: AvatarBadge(
initials: task.initials,
color: Color(0xFFE040FB),
size: 26,
),
),
),
SizedBox(width: 32, height: 26), // column 6, empty
],
),
);
}
}

View File

@ -13,6 +13,7 @@ class Toolbar extends StatelessWidget {
Padding(
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
child: Row(
spacing: 8,
children: [
Container(
padding: const EdgeInsets.symmetric(
@ -24,6 +25,7 @@ class Toolbar extends StatelessWidget {
borderRadius: BorderRadius.circular(2),
),
child: Row(
spacing: 6,
mainAxisSize: MainAxisSize.min,
children: [
Text(
@ -36,7 +38,6 @@ class Toolbar extends StatelessWidget {
color: Color(0xFFE2E8F0),
),
),
SizedBox(width: 6),
Text(
'Neue Aufgabe',
style: TextStyle(
@ -50,7 +51,6 @@ class Toolbar extends StatelessWidget {
],
),
),
SizedBox(width: 8),
Expanded(
child: Align(
alignment: Alignment.centerRight,
@ -72,4 +72,4 @@ class Toolbar extends StatelessWidget {
),
);
}
}
}