mirror of
https://github.com/Iconica-Development/flutter_availability.git
synced 2025-05-19 05:03:44 +02:00
fix: remove keyboard focus when opening dialogs for time selection
This commit is contained in:
parent
986d6a8d3f
commit
47b179dc4d
2 changed files with 12 additions and 9 deletions
|
@ -24,6 +24,7 @@ class TimeInputField extends StatelessWidget {
|
|||
var translations = options.translations;
|
||||
|
||||
Future<void> onFieldtap() async {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
var initialTime = initialValue ?? TimeOfDay.now();
|
||||
var time = await (options.timePickerBuilder?.call(context, initialTime) ??
|
||||
showTimePicker(
|
||||
|
|
|
@ -35,15 +35,17 @@ class PauseSelection extends StatelessWidget {
|
|||
|
||||
Future<BreakViewModel?> openBreakDialog(
|
||||
BreakViewModel? initialBreak,
|
||||
) async =>
|
||||
AvailabilityBreakSelectionDialog.show(
|
||||
context,
|
||||
initialBreak: initialBreak,
|
||||
userId: availabilityScope.userId,
|
||||
options: options,
|
||||
service: availabilityScope.service,
|
||||
editingTemplate: editingTemplate,
|
||||
);
|
||||
) async {
|
||||
FocusManager.instance.primaryFocus?.unfocus();
|
||||
return AvailabilityBreakSelectionDialog.show(
|
||||
context,
|
||||
initialBreak: initialBreak,
|
||||
userId: availabilityScope.userId,
|
||||
options: options,
|
||||
service: availabilityScope.service,
|
||||
editingTemplate: editingTemplate,
|
||||
);
|
||||
}
|
||||
|
||||
Future<void> onClickAddBreak() async {
|
||||
var newBreak = await openBreakDialog(null);
|
||||
|
|
Loading…
Reference in a new issue