Crossed out timetable objects when no teacher is assigned
This commit is contained in:
parent
b7bb3805a2
commit
1027727cac
@ -2,7 +2,6 @@
|
||||
import 'package:flutter/material.dart';
|
||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
|
||||
import '../../../api/webuntis/queries/getTimetable/getTimetableResponse.dart';
|
||||
import 'CrossPainter.dart';
|
||||
|
||||
class AppointmentComponent extends StatefulWidget {
|
||||
@ -117,7 +116,7 @@ class _AppointmentComponentState extends State<AppointmentComponent> {
|
||||
],
|
||||
),
|
||||
Visibility(
|
||||
visible: (meeting.id as GetTimetableResponseObject).code == "cancelled",
|
||||
visible: widget.crossedOut,
|
||||
child: Positioned.fill(
|
||||
child: CustomPaint(
|
||||
painter: CrossPainter(),
|
||||
|
@ -8,6 +8,7 @@ import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||
import '../../../api/webuntis/queries/getHolidays/getHolidaysResponse.dart';
|
||||
import '../../../api/webuntis/queries/getRooms/getRoomsResponse.dart';
|
||||
import '../../../api/webuntis/queries/getSubjects/getSubjectsResponse.dart';
|
||||
import '../../../api/webuntis/queries/getTimetable/getTimetableResponse.dart';
|
||||
import '../../../model/timetable/timetableProps.dart';
|
||||
import '../../../storage/base/settingsProvider.dart';
|
||||
import '../../../widget/loadingSpinner.dart';
|
||||
@ -119,7 +120,10 @@ class _TimetableState extends State<Timetable> {
|
||||
timeRegionBuilder: (BuildContext context, TimeRegionDetails timeRegionDetails) => TimeRegionComponent(details: timeRegionDetails),
|
||||
appointmentBuilder: (BuildContext context, CalendarAppointmentDetails details) => AppointmentComponent(
|
||||
details: details,
|
||||
crossedOut: value.getTimetableResponse.result.where((element) => element.id == details.appointments.first.id).firstOrNull?.code == "cancelled"
|
||||
crossedOut: (
|
||||
(details.appointments.first.id as GetTimetableResponseObject).code == "cancelled"
|
||||
|| (details.appointments.first.id as GetTimetableResponseObject).te.first.id == 0
|
||||
)
|
||||
),
|
||||
|
||||
headerHeight: 0,
|
||||
|
Loading…
x
Reference in New Issue
Block a user