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';
|
||||
|
||||
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),
|
||||
),
|
||||
];
|
||||
];
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
});
|
||||
}
|
||||
|
|
@ -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';
|
||||
|
||||
const headerStyle = TextStyle(
|
||||
fontFamily: 'Roboto',
|
||||
fontSize: 10,
|
||||
fontWeight: FontWeight.w600,
|
||||
height: 1.5,
|
||||
|
|
|
|||
|
|
@ -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),
|
||||
);
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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 {
|
|||
),
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Reference in New Issue