Remove old Server logic, cleanup

This commit is contained in:
2023-02-22 12:58:42 +01:00
parent bc24ca24cb
commit abad04554c
22 changed files with 36 additions and 677 deletions

View File

@ -14,20 +14,12 @@ import '../../../data/timetable/timetableProps.dart';
extension DateHelpers on DateTime {
bool isToday() {
final now = DateTime.now();
return now.day == this.day &&
now.month == this.month &&
now.year == this.year;
}
bool isYesterday() {
final yesterday = DateTime.now().subtract(Duration(days: 1));
return yesterday.day == this.day &&
yesterday.month == this.month &&
yesterday.year == this.year;
return now.day == day &&
now.month == month &&
now.year == year;
}
}
class WeekView extends StatefulWidget {
final TimetableProps value;
const WeekView(this.value, {Key? key}) : super(key: key);
@ -51,13 +43,13 @@ class _WeekViewState extends State<WeekView> {
showModalBottomSheet(context: context, builder: (context) => Column(
children: [
Padding(
padding: EdgeInsets.symmetric(vertical: 30),
padding: const EdgeInsets.symmetric(vertical: 30),
child: Center(
child: Column(
children: [
const Icon(Icons.info),
Icon(Icons.info, color: event.backgroundColor),
const SizedBox(height: 10),
Text("${subject.alternateName} - (${subject.longName})", style: const TextStyle(fontSize: 30)),
Text("${getEventPrefix(timetableData.code)}${subject.alternateName} - (${subject.longName})", style: const TextStyle(fontSize: 30)),
Text("${Jiffy(event.startTime).format("HH:mm")} - ${Jiffy(event.endTime).format("HH:mm")}", style: const TextStyle(fontSize: 15)),
],
),
@ -69,7 +61,7 @@ class _WeekViewState extends State<WeekView> {
children: [
ListTile(
leading: const Icon(Icons.notifications_active),
title: Text("Status: ${timetableData.code != null ? "Entfällt" : "Findet statt"}"),
title: Text("Status: ${timetableData.code != null ? "Geändert" : "Regulär"}"),
),
ListTile(
leading: const Icon(Icons.room),
@ -109,7 +101,6 @@ class _WeekViewState extends State<WeekView> {
List<LaneEvents> _buildLaneEvents(TimetableProps data) {
List<LaneEvents> laneEvents = List<LaneEvents>.empty(growable: true);
Jiffy.locale("de"); // todo move outwards
GetTimetableResponse timetable = data.getTimetableResponse;
GetRoomsResponse rooms = data.getRoomsResponse;