main
parent
9936172f3e
commit
d07d150244
|
|
@ -0,0 +1,52 @@
|
||||||
|
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(),
|
||||||
|
)
|
||||||
|
],
|
||||||
|
),
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,10 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class Table extends StatelessWidget {
|
||||||
|
const Table({super.key});
|
||||||
|
|
||||||
|
@override
|
||||||
|
Widget build(BuildContext context) {
|
||||||
|
return const Placeholder();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -2,9 +2,16 @@ import 'package:a1_aufgabenverwaltung/components/table_header_element.dart';
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
class TableHeader extends StatelessWidget {
|
class TableHeader extends StatelessWidget {
|
||||||
const TableHeader({super.key, required this.numberWidth, required this.statusWidth, required this.descriptionWidth});
|
const TableHeader({
|
||||||
|
super.key,
|
||||||
|
required this.numberWidth,
|
||||||
|
required this.statusWidth,
|
||||||
|
required this.descriptionWidth,
|
||||||
|
required this.todoWidth,
|
||||||
|
});
|
||||||
|
|
||||||
final double numberWidth;
|
final double numberWidth;
|
||||||
|
final double todoWidth;
|
||||||
final double statusWidth;
|
final double statusWidth;
|
||||||
final double descriptionWidth;
|
final double descriptionWidth;
|
||||||
|
|
||||||
|
|
@ -17,22 +24,26 @@ class TableHeader extends StatelessWidget {
|
||||||
height: 32,
|
height: 32,
|
||||||
decoration: BoxDecoration(
|
decoration: BoxDecoration(
|
||||||
color: backgroundColor,
|
color: backgroundColor,
|
||||||
border: Border(
|
border: Border(bottom: BorderSide(color: borderColor, width: 1)),
|
||||||
bottom: BorderSide(
|
|
||||||
color: borderColor,
|
|
||||||
width: 1
|
|
||||||
)
|
|
||||||
)
|
|
||||||
),
|
),
|
||||||
child: Padding(
|
child: Padding(
|
||||||
padding: const EdgeInsets.symmetric(horizontal: 20),
|
padding: const EdgeInsets.symmetric(horizontal: 20, vertical: 8),
|
||||||
child: Row(
|
child: Row(
|
||||||
spacing: 12,
|
spacing: 12,
|
||||||
children: [
|
children: [
|
||||||
TableHeaderElement(text: "#", width: 25),
|
TableHeaderElement(text: "#", width: numberWidth),
|
||||||
Expanded(child: TableHeaderElement(text: "Aufgabe", width: 240)),
|
Expanded(
|
||||||
Expanded(child: TableHeaderElement(text: "Status", width: 200)),
|
child: TableHeaderElement(text: "Aufgabe", width: todoWidth),
|
||||||
Expanded(child: TableHeaderElement(text: "Beschreibung", width: 493,)),
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TableHeaderElement(text: "Status", width: statusWidth),
|
||||||
|
),
|
||||||
|
Expanded(
|
||||||
|
child: TableHeaderElement(
|
||||||
|
text: "Beschreibung",
|
||||||
|
width: descriptionWidth,
|
||||||
|
),
|
||||||
|
),
|
||||||
SizedBox(width: 36),
|
SizedBox(width: 36),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
|
|
|
||||||
|
|
@ -12,6 +12,7 @@ class TableHeaderElement extends StatelessWidget {
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
return SizedBox(
|
return SizedBox(
|
||||||
width: width,
|
width: width,
|
||||||
|
height: 15,
|
||||||
child: Text(
|
child: Text(
|
||||||
text.toUpperCase(),
|
text.toUpperCase(),
|
||||||
style: TextStyle(
|
style: TextStyle(
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,19 @@
|
||||||
|
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: [
|
||||||
|
|
||||||
|
],
|
||||||
|
),
|
||||||
|
);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1,16 @@
|
||||||
|
import 'package:flutter/material.dart';
|
||||||
|
|
||||||
|
class TableRowElement extends StatelessWidget {
|
||||||
|
const TableRowElement({super.key, required this.width});
|
||||||
|
|
||||||
|
final double width;
|
||||||
|
|
||||||
|
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);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
@ -10,7 +10,10 @@ void main() {
|
||||||
class MainApp extends StatelessWidget {
|
class MainApp extends StatelessWidget {
|
||||||
const MainApp({super.key});
|
const MainApp({super.key});
|
||||||
|
|
||||||
statui
|
static const double numberWidth = 28;
|
||||||
|
static const double todoWidth = 240;
|
||||||
|
static const double statusWidth = 200;
|
||||||
|
static const double descriptionWidth = 493;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
Widget build(BuildContext context) {
|
Widget build(BuildContext context) {
|
||||||
|
|
@ -29,10 +32,15 @@ class MainApp extends StatelessWidget {
|
||||||
|
|
||||||
MainHeader(amountTodos: 6),
|
MainHeader(amountTodos: 6),
|
||||||
|
|
||||||
TableHeader(numberWidth: 28, statusWidth: ,),
|
TableHeader(
|
||||||
|
numberWidth: numberWidth,
|
||||||
|
todoWidth: todoWidth,
|
||||||
|
statusWidth: statusWidth,
|
||||||
|
descriptionWidth: 20,
|
||||||
|
),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
)
|
),
|
||||||
),
|
),
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,6 @@
|
||||||
|
enum Status {
|
||||||
|
done,
|
||||||
|
ongoing,
|
||||||
|
todo,
|
||||||
|
}
|
||||||
|
|
||||||
|
|
@ -0,0 +1,18 @@
|
||||||
|
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;
|
||||||
|
|
||||||
|
const Todo({
|
||||||
|
required this.todoTitle,
|
||||||
|
required this.status,
|
||||||
|
required this.description,
|
||||||
|
required this.userColor,
|
||||||
|
required this.initials,
|
||||||
|
});
|
||||||
|
}
|
||||||
Loading…
Reference in New Issue