resolved pr comments
This commit is contained in:
parent
e40760a07a
commit
90154880d0
@ -1,7 +1,8 @@
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:marianum_mobile/theming/darkAppTheme.dart';
|
|
||||||
|
|
||||||
enum CustomTimetableColors{
|
import '../../../theming/darkAppTheme.dart';
|
||||||
|
|
||||||
|
enum CustomTimetableColors {
|
||||||
orange,
|
orange,
|
||||||
red,
|
red,
|
||||||
green,
|
green,
|
||||||
@ -9,6 +10,8 @@ enum CustomTimetableColors{
|
|||||||
}
|
}
|
||||||
|
|
||||||
class TimetableColors {
|
class TimetableColors {
|
||||||
|
static const CustomTimetableColors defaultColor = CustomTimetableColors.orange;
|
||||||
|
|
||||||
static ColorModeDisplay getDisplayOptions(CustomTimetableColors color) {
|
static ColorModeDisplay getDisplayOptions(CustomTimetableColors color) {
|
||||||
switch(color) {
|
switch(color) {
|
||||||
case CustomTimetableColors.green:
|
case CustomTimetableColors.green:
|
||||||
@ -26,8 +29,8 @@ class TimetableColors {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
static Color getColorFromString(String color){
|
static Color getColorFromString(String color) {
|
||||||
return getDisplayOptions(CustomTimetableColors.values.firstWhere((element) => element.name == color, orElse: () => CustomTimetableColors.orange)).color;
|
return getDisplayOptions(CustomTimetableColors.values.firstWhere((element) => element.name == color, orElse: () => TimetableColors.defaultColor)).color;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -4,7 +4,6 @@ import 'dart:developer';
|
|||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:jiffy/jiffy.dart';
|
import 'package:jiffy/jiffy.dart';
|
||||||
import 'package:marianum_mobile/extensions/dateTime.dart';
|
import 'package:marianum_mobile/extensions/dateTime.dart';
|
||||||
import 'package:marianum_mobile/view/pages/timetable/custonTimetableColors.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:rrule_generator/rrule_generator.dart';
|
import 'package:rrule_generator/rrule_generator.dart';
|
||||||
import 'package:time_range_picker/time_range_picker.dart';
|
import 'package:time_range_picker/time_range_picker.dart';
|
||||||
@ -17,6 +16,7 @@ import '../../../api/mhsl/customTimetableEvent/update/updateCustomTimetableEvent
|
|||||||
import '../../../model/accountData.dart';
|
import '../../../model/accountData.dart';
|
||||||
import '../../../model/timetable/timetableProps.dart';
|
import '../../../model/timetable/timetableProps.dart';
|
||||||
import '../../../widget/infoDialog.dart';
|
import '../../../widget/infoDialog.dart';
|
||||||
|
import 'customTimetableColors.dart';
|
||||||
|
|
||||||
class CustomTimetableEventEditDialog extends StatefulWidget {
|
class CustomTimetableEventEditDialog extends StatefulWidget {
|
||||||
final CustomTimetableEvent? existingEvent;
|
final CustomTimetableEvent? existingEvent;
|
||||||
@ -35,7 +35,7 @@ class _AddCustomTimetableEventDialogState extends State<CustomTimetableEventEdit
|
|||||||
late String _recurringRule = widget.existingEvent?.rrule ?? "";
|
late String _recurringRule = widget.existingEvent?.rrule ?? "";
|
||||||
late CustomTimetableColors _customTimetableColor = CustomTimetableColors.values.firstWhere(
|
late CustomTimetableColors _customTimetableColor = CustomTimetableColors.values.firstWhere(
|
||||||
(element) => element.name == widget.existingEvent?.color,
|
(element) => element.name == widget.existingEvent?.color,
|
||||||
orElse: () => CustomTimetableColors.orange
|
orElse: () => TimetableColors.defaultColor
|
||||||
);
|
);
|
||||||
|
|
||||||
late bool isEditingExisting = widget.existingEvent != null;
|
late bool isEditingExisting = widget.existingEvent != null;
|
||||||
|
@ -3,7 +3,6 @@ import 'dart:async';
|
|||||||
|
|
||||||
import 'package:flutter/material.dart';
|
import 'package:flutter/material.dart';
|
||||||
import 'package:marianum_mobile/extensions/dateTime.dart';
|
import 'package:marianum_mobile/extensions/dateTime.dart';
|
||||||
import 'package:marianum_mobile/view/pages/timetable/custonTimetableColors.dart';
|
|
||||||
import 'package:provider/provider.dart';
|
import 'package:provider/provider.dart';
|
||||||
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
import 'package:syncfusion_flutter_calendar/calendar.dart';
|
||||||
|
|
||||||
@ -18,6 +17,7 @@ import '../../../widget/placeholderView.dart';
|
|||||||
import 'appointmenetComponent.dart';
|
import 'appointmenetComponent.dart';
|
||||||
import 'appointmentDetails.dart';
|
import 'appointmentDetails.dart';
|
||||||
import 'arbitraryAppointment.dart';
|
import 'arbitraryAppointment.dart';
|
||||||
|
import 'customTimetableColors.dart';
|
||||||
import 'customTimetableEventEditDialog.dart';
|
import 'customTimetableEventEditDialog.dart';
|
||||||
import 'timeRegionComponent.dart';
|
import 'timeRegionComponent.dart';
|
||||||
import 'timetableEvents.dart';
|
import 'timetableEvents.dart';
|
||||||
@ -290,7 +290,7 @@ class _TimetableState extends State<Timetable> {
|
|||||||
location: customEvent.description,
|
location: customEvent.description,
|
||||||
subject: customEvent.title,
|
subject: customEvent.title,
|
||||||
recurrenceRule: customEvent.rrule,
|
recurrenceRule: customEvent.rrule,
|
||||||
color: TimetableColors.getColorFromString(customEvent.color ?? CustomTimetableColors.orange.name),
|
color: TimetableColors.getColorFromString(customEvent.color ?? TimetableColors.defaultColor.name),
|
||||||
startTimeZone: '',
|
startTimeZone: '',
|
||||||
endTimeZone: '',
|
endTimeZone: '',
|
||||||
);
|
);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user