mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 05:03:44 +02:00
feat: add close button for pause selection dialog
This commit is contained in:
parent
db6d343fb4
commit
986d6a8d3f
1 changed files with 61 additions and 48 deletions
|
@ -296,59 +296,72 @@ class _AvailabilityBreakSelectionDialogState
|
||||||
? translations.pauseDialogDescriptionTemplate
|
? translations.pauseDialogDescriptionTemplate
|
||||||
: translations.pauseDialogDescriptionAvailability;
|
: translations.pauseDialogDescriptionAvailability;
|
||||||
|
|
||||||
return Container(
|
return Stack(
|
||||||
margin: EdgeInsets.symmetric(
|
children: [
|
||||||
horizontal: spacing.sidePadding,
|
Container(
|
||||||
),
|
margin: EdgeInsets.symmetric(
|
||||||
child: SingleChildScrollView(
|
horizontal: spacing.sidePadding,
|
||||||
child: Column(
|
),
|
||||||
children: [
|
child: SingleChildScrollView(
|
||||||
const SizedBox(height: 44),
|
child: Column(
|
||||||
Text(
|
|
||||||
translations.pauseDialogTitle,
|
|
||||||
style: textTheme.titleMedium,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 4),
|
|
||||||
Text(
|
|
||||||
descriptionText,
|
|
||||||
style: textTheme.bodyMedium,
|
|
||||||
textAlign: TextAlign.center,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 16),
|
|
||||||
Row(
|
|
||||||
children: [
|
children: [
|
||||||
const Spacer(),
|
const SizedBox(height: 44),
|
||||||
Expanded(
|
Text(
|
||||||
flex: 2,
|
translations.pauseDialogTitle,
|
||||||
child: DurationInputField(
|
style: textTheme.titleMedium,
|
||||||
initialValue: _breakViewModel.submittedDuration,
|
textAlign: TextAlign.center,
|
||||||
onDurationChanged: onUpdateDuration,
|
|
||||||
),
|
|
||||||
),
|
),
|
||||||
const Spacer(),
|
const SizedBox(height: 4),
|
||||||
|
Text(
|
||||||
|
descriptionText,
|
||||||
|
style: textTheme.bodyMedium,
|
||||||
|
textAlign: TextAlign.center,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 16),
|
||||||
|
Row(
|
||||||
|
children: [
|
||||||
|
const Spacer(),
|
||||||
|
Expanded(
|
||||||
|
flex: 2,
|
||||||
|
child: DurationInputField(
|
||||||
|
initialValue: _breakViewModel.submittedDuration,
|
||||||
|
onDurationChanged: onUpdateDuration,
|
||||||
|
),
|
||||||
|
),
|
||||||
|
const Spacer(),
|
||||||
|
],
|
||||||
|
),
|
||||||
|
const SizedBox(height: 24),
|
||||||
|
TimeSelection(
|
||||||
|
key: ValueKey(
|
||||||
|
[_breakViewModel.startTime, _breakViewModel.endTime],
|
||||||
|
),
|
||||||
|
// rebuild the widget when the start or end time changes
|
||||||
|
title: translations.pauseDialogPeriodTitle,
|
||||||
|
description: translations.pauseDialogPeriodDescription,
|
||||||
|
crossAxisAlignment: CrossAxisAlignment.center,
|
||||||
|
startTime: _breakViewModel.startTime,
|
||||||
|
endTime: _breakViewModel.endTime,
|
||||||
|
onStartChanged: onUpdateStart,
|
||||||
|
onEndChanged: onUpdateEnd,
|
||||||
|
),
|
||||||
|
const SizedBox(height: 36),
|
||||||
|
saveButton,
|
||||||
|
SizedBox(height: spacing.bottomButtonPadding),
|
||||||
],
|
],
|
||||||
),
|
),
|
||||||
const SizedBox(height: 24),
|
),
|
||||||
TimeSelection(
|
|
||||||
key: ValueKey(
|
|
||||||
[_breakViewModel.startTime, _breakViewModel.endTime],
|
|
||||||
),
|
|
||||||
// rebuild the widget when the start or end time changes
|
|
||||||
title: translations.pauseDialogPeriodTitle,
|
|
||||||
description: translations.pauseDialogPeriodDescription,
|
|
||||||
crossAxisAlignment: CrossAxisAlignment.center,
|
|
||||||
startTime: _breakViewModel.startTime,
|
|
||||||
endTime: _breakViewModel.endTime,
|
|
||||||
onStartChanged: onUpdateStart,
|
|
||||||
onEndChanged: onUpdateEnd,
|
|
||||||
),
|
|
||||||
const SizedBox(height: 36),
|
|
||||||
saveButton,
|
|
||||||
SizedBox(height: spacing.bottomButtonPadding),
|
|
||||||
],
|
|
||||||
),
|
),
|
||||||
),
|
Positioned(
|
||||||
|
right: 0,
|
||||||
|
top: 0,
|
||||||
|
child: IconButton(
|
||||||
|
padding: const EdgeInsets.all(16),
|
||||||
|
icon: const Icon(Icons.close),
|
||||||
|
onPressed: () => Navigator.of(context).pop(),
|
||||||
|
),
|
||||||
|
),
|
||||||
|
],
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue