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

resolved issue #18 (tap OK button make a blank screen after AutoClose elapsed time) #19

Closed wasibhussain closed 1 year ago

wasibhussain commented 1 year ago

So, the black screen issue occurred because of the autoCloseDuration parameter , When the user tapped on the OK or Cancel button in the dialog, the dialog close immediately. However, autoCloseDuration value used in the future.delayed method and callback run which try to close dialog as dialog already closed by the user okay/cancel button, callback function pop off another activity

To address this issue, I made a modification in the quickalert_dialog.dart file. Instead of using Future.delayed, I used a Timer to handle the automatic closing of the dialog. By using a Timer, you can cancel it if the user taps on the OK or Cancel button, preventing the occurrence of the black screen.

With this modification, the dialog now closes promptly when the user interacts with it, without any delay caused by the autoCloseDuration. This prevents the additional screen popping and the resulting black screen.