diff --git a/assets/fonts/Roboto-Bold.ttf b/assets/fonts/Roboto-Bold.ttf new file mode 100644 index 0000000..6516185 Binary files /dev/null and b/assets/fonts/Roboto-Bold.ttf differ diff --git a/assets/fonts/Roboto-Regular.ttf b/assets/fonts/Roboto-Regular.ttf new file mode 100644 index 0000000..3db0d1f Binary files /dev/null and b/assets/fonts/Roboto-Regular.ttf differ diff --git a/assets/fonts/Roboto-SemiBold.ttf b/assets/fonts/Roboto-SemiBold.ttf new file mode 100644 index 0000000..7a8ef87 Binary files /dev/null and b/assets/fonts/Roboto-SemiBold.ttf differ diff --git a/lib/data/sample_tasks.dart b/lib/data/sample_tasks.dart index fa916ef..b6b0902 100644 --- a/lib/data/sample_tasks.dart +++ b/lib/data/sample_tasks.dart @@ -1,3 +1,5 @@ +import 'package:flutter/material.dart'; + import '../models/task.dart'; const sampleTasks = [ @@ -6,35 +8,41 @@ const sampleTasks = [ description: 'Swagger-Spezifikation für alle REST-Endpunkte erstellen', status: TaskStatus.erledigt, initials: 'LM', + avatarColor: Color(0xFFE040FB), ), Task( title: 'Datenbankschema migrieren', description: 'Schema v2.1 auf Produktionsserver anwenden und testen', status: TaskStatus.inBearbeitung, initials: 'AB', + avatarColor: Color(0xFF3B82F6), ), Task( title: 'CI/CD-Pipeline einrichten', description: 'GitHub Actions für automatische Deployments konfigurieren', status: TaskStatus.inBearbeitung, initials: 'SK', + avatarColor: Color(0xFFF59E0B), ), Task( title: 'Sicherheitsaudit durchführen', description: 'Penetrationstest und OWASP-Prüfung beauftragen', status: TaskStatus.nichtBegonnen, initials: 'TF', + avatarColor: Color(0xFFA78BFA), ), Task( title: 'Nutzerhandbuch überarbeiten', description: 'Onboarding-Dokumentation für Release 3.0 aktualisieren', status: TaskStatus.nichtBegonnen, initials: 'LM', + avatarColor: Color(0xFFE040FB), ), Task( title: 'Performance-Benchmarks', description: 'Ladezeiten messen und Optimierungspotenzial identifizieren', status: TaskStatus.erledigt, initials: 'SK', + avatarColor: Color(0xFFF59E0B), ), -]; \ No newline at end of file +]; diff --git a/lib/main.dart b/lib/main.dart index bfe18e7..c21db17 100644 --- a/lib/main.dart +++ b/lib/main.dart @@ -1,8 +1,10 @@ import 'package:flutter/material.dart'; + import 'widgets/app_header.dart'; import 'widgets/toolbar.dart'; import 'widgets/table_header.dart'; import 'widgets/task_list.dart'; +import 'widgets/footer_bar.dart'; void main() { runApp(const MainApp()); @@ -13,23 +15,26 @@ class MainApp extends StatelessWidget { @override Widget build(BuildContext context) { + final screenWidth = MediaQuery.of(context).size.width; + final appWidth = screenWidth < 750 ? 750.0 : screenWidth; + return MaterialApp( theme: ThemeData(fontFamily: 'Roboto'), home: Scaffold( - body: Align( - alignment: Alignment.topCenter, + body: SingleChildScrollView( + scrollDirection: Axis.horizontal, child: Container( - width: double.infinity, + width: appWidth, height: 750, color: Color(0xFF0F1117), child: Column( crossAxisAlignment: CrossAxisAlignment.stretch, children: [ - AppHeader(), // 1. Header - Toolbar(), // 2. Toolbar - TableHeader(), // 3. Table header + AppHeader(), + Toolbar(), + TableHeader(), Expanded(child: TaskList()), - // 5. Footer + FooterBar(), ], ), ), @@ -37,4 +42,4 @@ class MainApp extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/lib/models/task.dart b/lib/models/task.dart index efb66c3..72ae304 100644 --- a/lib/models/task.dart +++ b/lib/models/task.dart @@ -1,3 +1,5 @@ +import 'package:flutter/material.dart'; + enum TaskStatus { erledigt, inBearbeitung, nichtBegonnen } class Task { @@ -5,11 +7,13 @@ class Task { final String description; final TaskStatus status; final String initials; + final Color avatarColor; const Task({ required this.title, required this.description, required this.status, required this.initials, + required this.avatarColor, }); } \ No newline at end of file diff --git a/lib/widgets/footer_bar.dart b/lib/widgets/footer_bar.dart new file mode 100644 index 0000000..53d952e --- /dev/null +++ b/lib/widgets/footer_bar.dart @@ -0,0 +1,64 @@ +import 'package:flutter/material.dart'; +import '../data/sample_tasks.dart'; +import '../models/task.dart'; + +class FooterBar extends StatelessWidget { + const FooterBar({super.key}); + + int _count(TaskStatus status) { + int n = 0; + for (final task in sampleTasks) { + if (task.status == status) { + n++; + } + } + return n; + } + + @override + Widget build(BuildContext context) { + return Container( + height: 28, + color: const Color(0xFF0B0E16), + child: Column( + children: [ + Container(height: 1, color: const Color(0xFF1E2D3D)), + Expanded( + child: Padding( + padding: const EdgeInsets.symmetric(horizontal: 20), + child: Row( + spacing: 16, + children: [ + Text( + '✓ ${_count(TaskStatus.erledigt)} Erledigt', + style: TextStyle( + fontSize: 10, + height: 1.5, + color: Color(0xFF10B981), + ), + ), + Text( + '◈ ${_count(TaskStatus.inBearbeitung)} In Bearbeitung', + style: TextStyle( + fontSize: 10, + height: 1.5, + color: Color(0xFFF59E0B), + ), + ), + Text( + '○ ${_count(TaskStatus.nichtBegonnen)} Nicht begonnen', + style: TextStyle( + fontSize: 10, + height: 1.5, + color: Color(0xFF64748B), + ), + ), + ], + ), + ), + ), + ], + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/status_badge.dart b/lib/widgets/status_badge.dart new file mode 100644 index 0000000..9919b26 --- /dev/null +++ b/lib/widgets/status_badge.dart @@ -0,0 +1,54 @@ +import 'package:flutter/material.dart'; + +class StatusBadge extends StatelessWidget { + final String icon; + final String label; + final Color fillColor; + final Color borderColor; + + const StatusBadge({ + super.key, + required this.icon, + required this.label, + required this.fillColor, + required this.borderColor, + }); + + @override + Widget build(BuildContext context) { + return Container( + padding: const EdgeInsets.all(1), + color: borderColor, + child: Container( + padding: const EdgeInsets.symmetric(horizontal: 8, vertical: 2), + color: fillColor, + child: Row( + spacing: 4, + mainAxisSize: MainAxisSize.min, + children: [ + Text( + icon, + style: TextStyle( + fontSize: 10, + fontWeight: FontWeight.w600, + height: 1.5, + letterSpacing: 0.55, + color: borderColor, + ), + ), + Text( + label, + style: TextStyle( + fontSize: 11, + fontWeight: FontWeight.w600, + height: 17 / 11, + letterSpacing: 0.55, + color: borderColor, + ), + ), + ], + ), + ), + ); + } +} \ No newline at end of file diff --git a/lib/widgets/table_header.dart b/lib/widgets/table_header.dart index 0877e31..02a96d1 100644 --- a/lib/widgets/table_header.dart +++ b/lib/widgets/table_header.dart @@ -1,7 +1,6 @@ import 'package:flutter/material.dart'; const headerStyle = TextStyle( - fontFamily: 'Roboto', fontSize: 10, fontWeight: FontWeight.w600, height: 1.5, diff --git a/lib/widgets/task_row.dart b/lib/widgets/task_row.dart index 902d48f..5c80e51 100644 --- a/lib/widgets/task_row.dart +++ b/lib/widgets/task_row.dart @@ -2,6 +2,7 @@ import 'package:flutter/material.dart'; import 'avatar_badge.dart'; import '../models/task.dart'; +import 'status_badge.dart'; class TaskRow extends StatelessWidget { final Task task; @@ -18,9 +19,36 @@ class TaskRow extends StatelessWidget { 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 + SizedBox( + width: 28, + child: Text( + number.toString().padLeft(2, '0'), + style: TextStyle( + fontSize: 11, + height: 17 / 11, + color: Color(0xFF64748B), + ), + ), + ), + SizedBox( + width: 240, + child: Text( + task.title, + style: TextStyle( + fontSize: 12, + fontWeight: FontWeight.w600, + height: 1.5, + color: Color(0xFFE2E8F0), + ), + ), + ), + SizedBox( + width: 200, + child: Align( + alignment: Alignment.centerLeft, + child: _badge(task.status), + ), + ), Expanded( child: Text( task.description, @@ -38,7 +66,7 @@ class TaskRow extends StatelessWidget { alignment: Alignment.centerLeft, child: AvatarBadge( initials: task.initials, - color: Color(0xFFE040FB), + color: task.avatarColor, size: 26, ), ), @@ -48,4 +76,29 @@ class TaskRow extends StatelessWidget { ), ); } + + Widget _badge(TaskStatus status) { + if (status == TaskStatus.erledigt) { + return StatusBadge( + icon: '✓', + label: 'ERLEDIGT', + fillColor: Color(0xFF052E16), + borderColor: Color(0xFF10B981), + ); + } + if (status == TaskStatus.inBearbeitung) { + return StatusBadge( + icon: '◈', + label: 'IN BEARBEITUNG', + fillColor: Color(0xFF1C1100), + borderColor: Color(0xFFF59E0B), + ); + } + return StatusBadge( + icon: '○', + label: 'NICHT BEGONNEN', + fillColor: Color(0xFF0F1117), + borderColor: Color(0xFF64748B), + ); + } } diff --git a/lib/widgets/toolbar.dart b/lib/widgets/toolbar.dart index 049118a..42d996d 100644 --- a/lib/widgets/toolbar.dart +++ b/lib/widgets/toolbar.dart @@ -1,5 +1,7 @@ import 'package:flutter/material.dart'; +import '../data/sample_tasks.dart'; + class Toolbar extends StatelessWidget { const Toolbar({super.key}); @@ -55,7 +57,7 @@ class Toolbar extends StatelessWidget { child: Align( alignment: Alignment.centerRight, child: Text( - '6 Aufgaben', + '${sampleTasks.length} Aufgaben', style: TextStyle( fontSize: 11, height: 17 / 11, @@ -72,4 +74,4 @@ class Toolbar extends StatelessWidget { ), ); } -} \ No newline at end of file +} diff --git a/pubspec.yaml b/pubspec.yaml index 80ac177..28abc88 100644 --- a/pubspec.yaml +++ b/pubspec.yaml @@ -19,3 +19,9 @@ flutter: uses-material-design: true fonts: - family: Roboto + fonts: + - asset: assets/fonts/Roboto-Regular.ttf + - asset: assets/fonts/Roboto-SemiBold.ttf + weight: 600 + - asset: assets/fonts/Roboto-Bold.ttf + weight: 700