You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
20 lines
532 B
Dart
20 lines
532 B
Dart
import 'package:flutter/material.dart';
|
|
import 'work_interval.dart';
|
|
|
|
class WorkDay {
|
|
final DateTime date;
|
|
final List<WorkInterval> intervals; // bis zu 5
|
|
final String? code; // GZ, K, U, SU, T oder null
|
|
final int targetMinutes; // Soll
|
|
|
|
const WorkDay({
|
|
required this.date,
|
|
required this.intervals,
|
|
required this.targetMinutes,
|
|
this.code,
|
|
});
|
|
|
|
int get workedMinutes => intervals.fold(0, (sum, i) => sum + i.minutes);
|
|
int get diffMinutes => workedMinutes - targetMinutes;
|
|
}
|