mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 13:13:44 +02:00
feat: add marking for conflicting times when applying a template
This commit is contained in:
parent
eb704f44cd
commit
7204f77d05
2 changed files with 7 additions and 0 deletions
|
@ -130,6 +130,10 @@ class AvailabilityViewModel {
|
||||||
templateSelected ||
|
templateSelected ||
|
||||||
(startTime != null && endTime != null);
|
(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
|
/// Whether a template deviation should be shown to the user
|
||||||
bool get isDeviatingFromTemplate =>
|
bool get isDeviatingFromTemplate =>
|
||||||
startTime != null &&
|
startTime != null &&
|
||||||
|
|
|
@ -40,6 +40,8 @@ class AvailabilityTimeSelection extends StatelessWidget {
|
||||||
explanationText = isSingleDay
|
explanationText = isSingleDay
|
||||||
? translations.availabilityTemplateDeviationExplanation
|
? translations.availabilityTemplateDeviationExplanation
|
||||||
: translations.availabilitiesTemplateDeviationExplanation;
|
: translations.availabilitiesTemplateDeviationExplanation;
|
||||||
|
} else if (viewModel.showConflictingMessage) {
|
||||||
|
explanationText = translations.availabilitiesConflictingTimeExplanation;
|
||||||
}
|
}
|
||||||
|
|
||||||
return Column(
|
return Column(
|
||||||
|
@ -68,6 +70,7 @@ class _AvailabilityExplanation extends StatelessWidget {
|
||||||
required this.explanation,
|
required this.explanation,
|
||||||
});
|
});
|
||||||
|
|
||||||
|
/// The explanation text to show to the user
|
||||||
final String explanation;
|
final String explanation;
|
||||||
|
|
||||||
@override
|
@override
|
||||||
|
|
Loading…
Reference in a new issue