feat: add marking for conflicting times when applying a template

This commit is contained in:
Freek van de Ven 2024-07-26 10:27:48 +02:00 committed by FlutterJoey
parent eb704f44cd
commit 7204f77d05
2 changed files with 7 additions and 0 deletions

View file

@ -130,6 +130,10 @@ class AvailabilityViewModel {
templateSelected ||
(startTime != null && endTime != null);
/// Whether a message should be shown to the user that the start and end times
/// are conflicting and they can't be filled in automatically
bool get showConflictingMessage => templateSelected && conflictingTime;
/// Whether a template deviation should be shown to the user
bool get isDeviatingFromTemplate =>
startTime != null &&

View file

@ -40,6 +40,8 @@ class AvailabilityTimeSelection extends StatelessWidget {
explanationText = isSingleDay
? translations.availabilityTemplateDeviationExplanation
: translations.availabilitiesTemplateDeviationExplanation;
} else if (viewModel.showConflictingMessage) {
explanationText = translations.availabilitiesConflictingTimeExplanation;
}
return Column(
@ -68,6 +70,7 @@ class _AvailabilityExplanation extends StatelessWidget {
required this.explanation,
});
/// The explanation text to show to the user
final String explanation;
@override