added status badge, modified some of the layout, added footer, added the font family roboto. CA2 almost done, one last check needed
parent
7064f68229
commit
8f9cb373f0
Binary file not shown.
Binary file not shown.
Binary file not shown.
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import '../models/task.dart';
|
import '../models/task.dart';
|
||||||
|
|
||||||
const sampleTasks = [
|
const sampleTasks = [
|
||||||
|
|
@ -6,35 +8,41 @@ const sampleTasks = [
|
||||||
description: 'Swagger-Spezifikation für alle REST-Endpunkte erstellen',
|
description: 'Swagger-Spezifikation für alle REST-Endpunkte erstellen',
|
||||||
status: TaskStatus.erledigt,
|
status: TaskStatus.erledigt,
|
||||||
initials: 'LM',
|
initials: 'LM',
|
||||||
|
avatarColor: Color(0xFFE040FB),
|
||||||
),
|
),
|
||||||
Task(
|
Task(
|
||||||
title: 'Datenbankschema migrieren',
|
title: 'Datenbankschema migrieren',
|
||||||
description: 'Schema v2.1 auf Produktionsserver anwenden und testen',
|
description: 'Schema v2.1 auf Produktionsserver anwenden und testen',
|
||||||
status: TaskStatus.inBearbeitung,
|
status: TaskStatus.inBearbeitung,
|
||||||
initials: 'AB',
|
initials: 'AB',
|
||||||
|
avatarColor: Color(0xFF3B82F6),
|
||||||
),
|
),
|
||||||
Task(
|
Task(
|
||||||
title: 'CI/CD-Pipeline einrichten',
|
title: 'CI/CD-Pipeline einrichten',
|
||||||
description: 'GitHub Actions für automatische Deployments konfigurieren',
|
description: 'GitHub Actions für automatische Deployments konfigurieren',
|
||||||
status: TaskStatus.inBearbeitung,
|
status: TaskStatus.inBearbeitung,
|
||||||
initials: 'SK',
|
initials: 'SK',
|
||||||
|
avatarColor: Color(0xFFF59E0B),
|
||||||
),
|
),
|
||||||
Task(
|
Task(
|
||||||
title: 'Sicherheitsaudit durchführen',
|
title: 'Sicherheitsaudit durchführen',
|
||||||
description: 'Penetrationstest und OWASP-Prüfung beauftragen',
|
description: 'Penetrationstest und OWASP-Prüfung beauftragen',
|
||||||
status: TaskStatus.nichtBegonnen,
|
status: TaskStatus.nichtBegonnen,
|
||||||
initials: 'TF',
|
initials: 'TF',
|
||||||
|
avatarColor: Color(0xFFA78BFA),
|
||||||
),
|
),
|
||||||
Task(
|
Task(
|
||||||
title: 'Nutzerhandbuch überarbeiten',
|
title: 'Nutzerhandbuch überarbeiten',
|
||||||
description: 'Onboarding-Dokumentation für Release 3.0 aktualisieren',
|
description: 'Onboarding-Dokumentation für Release 3.0 aktualisieren',
|
||||||
status: TaskStatus.nichtBegonnen,
|
status: TaskStatus.nichtBegonnen,
|
||||||
initials: 'LM',
|
initials: 'LM',
|
||||||
|
avatarColor: Color(0xFFE040FB),
|
||||||
),
|
),
|
||||||
Task(
|
Task(
|
||||||
title: 'Performance-Benchmarks',
|
title: 'Performance-Benchmarks',
|
||||||
description: 'Ladezeiten messen und Optimierungspotenzial identifizieren',
|
description: 'Ladezeiten messen und Optimierungspotenzial identifizieren',
|
||||||
status: TaskStatus.erledigt,
|
status: TaskStatus.erledigt,
|
||||||
initials: 'SK',
|
initials: 'SK',
|
||||||
|
avatarColor: Color(0xFFF59E0B),
|
||||||
),
|
),
|
||||||
];
|
];
|
||||||
|
|
|
||||||
|
|
@ -1,8 +1,10 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'widgets/app_header.dart';
|
import 'widgets/app_header.dart';
|
||||||
import 'widgets/toolbar.dart';
|
import 'widgets/toolbar.dart';
|
||||||
import 'widgets/table_header.dart';
|
import 'widgets/table_header.dart';
|
||||||
import 'widgets/task_list.dart';
|
import 'widgets/task_list.dart';
|
||||||
|
import 'widgets/footer_bar.dart';
|
||||||
|
|
||||||
void main() {
|
void main() {
|
||||||
runApp(const MainApp());
|
runApp(const MainApp());
|
||||||
|
|
@ -13,23 +15,26 @@ class MainApp extends StatelessWidget {
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
final screenWidth = MediaQuery.of(context).size.width;
|
||||||
|
final appWidth = screenWidth < 750 ? 750.0 : screenWidth;
|
||||||
|
|
||||||
return MaterialApp(
|
return MaterialApp(
|
||||||
theme: ThemeData(fontFamily: 'Roboto'),
|
theme: ThemeData(fontFamily: 'Roboto'),
|
||||||
home: Scaffold(
|
home: Scaffold(
|
||||||
body: Align(
|
body: SingleChildScrollView(
|
||||||
alignment: Alignment.topCenter,
|
scrollDirection: Axis.horizontal,
|
||||||
child: Container(
|
child: Container(
|
||||||
width: double.infinity,
|
width: appWidth,
|
||||||
height: 750,
|
height: 750,
|
||||||
color: Color(0xFF0F1117),
|
color: Color(0xFF0F1117),
|
||||||
child: Column(
|
child: Column(
|
||||||
crossAxisAlignment: CrossAxisAlignment.stretch,
|
crossAxisAlignment: CrossAxisAlignment.stretch,
|
||||||
children: [
|
children: [
|
||||||
AppHeader(), // 1. Header
|
AppHeader(),
|
||||||
Toolbar(), // 2. Toolbar
|
Toolbar(),
|
||||||
TableHeader(), // 3. Table header
|
TableHeader(),
|
||||||
Expanded(child: TaskList()),
|
Expanded(child: TaskList()),
|
||||||
// 5. Footer
|
FooterBar(),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
),
|
),
|
||||||
|
|
@ -37,4 +42,4 @@ class MainApp extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
enum TaskStatus { erledigt, inBearbeitung, nichtBegonnen }
|
enum TaskStatus { erledigt, inBearbeitung, nichtBegonnen }
|
||||||
|
|
||||||
class Task {
|
class Task {
|
||||||
|
|
@ -5,11 +7,13 @@ class Task {
|
||||||
final String description;
|
final String description;
|
||||||
final TaskStatus status;
|
final TaskStatus status;
|
||||||
final String initials;
|
final String initials;
|
||||||
|
final Color avatarColor;
|
||||||
|
|
||||||
const Task({
|
const Task({
|
||||||
required this.title,
|
required this.title,
|
||||||
required this.description,
|
required this.description,
|
||||||
required this.status,
|
required this.status,
|
||||||
required this.initials,
|
required this.initials,
|
||||||
|
required this.avatarColor,
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
@ -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),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -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,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -1,7 +1,6 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
const headerStyle = TextStyle(
|
const headerStyle = TextStyle(
|
||||||
fontFamily: 'Roboto',
|
|
||||||
fontSize: 10,
|
fontSize: 10,
|
||||||
fontWeight: FontWeight.w600,
|
fontWeight: FontWeight.w600,
|
||||||
height: 1.5,
|
height: 1.5,
|
||||||
|
|
|
||||||
|
|
@ -2,6 +2,7 @@ import 'package:flutter/material.dart';
|
||||||
|
|
||||||
import 'avatar_badge.dart';
|
import 'avatar_badge.dart';
|
||||||
import '../models/task.dart';
|
import '../models/task.dart';
|
||||||
|
import 'status_badge.dart';
|
||||||
|
|
||||||
class TaskRow extends StatelessWidget {
|
class TaskRow extends StatelessWidget {
|
||||||
final Task task;
|
final Task task;
|
||||||
|
|
@ -18,9 +19,36 @@ class TaskRow extends StatelessWidget {
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
children: [
|
children: [
|
||||||
SizedBox(width: 28, child: Text(number.toString().padLeft(2, '0'))),
|
SizedBox(
|
||||||
SizedBox(width: 240, child: Text(task.title)),
|
width: 28,
|
||||||
SizedBox(width: 200, child: Text(task.status.name)), // TODO: badge
|
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(
|
Expanded(
|
||||||
child: Text(
|
child: Text(
|
||||||
task.description,
|
task.description,
|
||||||
|
|
@ -38,7 +66,7 @@ class TaskRow extends StatelessWidget {
|
||||||
alignment: Alignment.centerLeft,
|
alignment: Alignment.centerLeft,
|
||||||
child: AvatarBadge(
|
child: AvatarBadge(
|
||||||
initials: task.initials,
|
initials: task.initials,
|
||||||
color: Color(0xFFE040FB),
|
color: task.avatarColor,
|
||||||
size: 26,
|
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),
|
||||||
|
);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,5 +1,7 @@
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
import '../data/sample_tasks.dart';
|
||||||
|
|
||||||
class Toolbar extends StatelessWidget {
|
class Toolbar extends StatelessWidget {
|
||||||
const Toolbar({super.key});
|
const Toolbar({super.key});
|
||||||
|
|
||||||
|
|
@ -55,7 +57,7 @@ class Toolbar extends StatelessWidget {
|
||||||
child: Align(
|
child: Align(
|
||||||
alignment: Alignment.centerRight,
|
alignment: Alignment.centerRight,
|
||||||
child: Text(
|
child: Text(
|
||||||
'6 Aufgaben',
|
'${sampleTasks.length} Aufgaben',
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
fontSize: 11,
|
fontSize: 11,
|
||||||
height: 17 / 11,
|
height: 17 / 11,
|
||||||
|
|
@ -72,4 +74,4 @@ class Toolbar extends StatelessWidget {
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -19,3 +19,9 @@ flutter:
|
||||||
uses-material-design: true
|
uses-material-design: true
|
||||||
fonts:
|
fonts:
|
||||||
- family: Roboto
|
- 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
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue