mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-18 20:53:45 +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 ||
|
||||
(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 &&
|
||||
|
|
|
@ -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
|
||||
|
|
Loading…
Reference in a new issue