belovance / QuickAlert

An instantly ready, full-featured alerts for development on any platform with flutter. Enabling you to complete projects and deploy quickly. With QuickAlert, you can display animated alert dialogs such as success, error, warning, confirm, loading or even a custom dialog.
https://pub.dev/packages/quickalert
MIT License
46 stars 42 forks source link

Add option to dismiss alert with keyboard "Enter/Cancel" pressed #27

Closed matteoberla closed 5 months ago

matteoberla commented 8 months ago

Hi, i've noticed that either if the keyboard is opened on the screen or if i'm using an external keyboard (or another input device) or I'm on flutter web, it's not possible to dismiss the alert with a button press from the keyboard.

The solution would be:

I think it would be useful as the user hasn't to pass between the keyboard and the tap each time an alert is showed. Thanks.

ItsAkashS22 commented 5 months ago

Hello @matteoberla 👋🏻

We have implemented Enter key for confirm actions in alerts. The existing use of the Escape key for dismissing alerts introduces a conflict with using the same for cancel actions, as the Escape key is already widely recognized for dismissal in user interfaces. This standard prevents us from assigning escape key for cancel action without causing confusion. Hence we'll only support keyboard action for confirmation with enter and not support keyboard action for cancel action for now.

Thanks & Happy Coding ✨