Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cancel functionality #30

Open
avdhootu27 opened this issue Apr 13, 2024 · 4 comments
Open

Cancel functionality #30

avdhootu27 opened this issue Apr 13, 2024 · 4 comments
Labels
enhancement New feature or request question Further information is requested

Comments

@avdhootu27
Copy link

Is your feature request related to a problem? Please describe.
I am using AppLock.of(context)!.showLockScreen(); to open the app lock screen at a certain point in my app but if I am supposed to go back I can't. Because the app is in a locked state. So If I don't want to enter the password and unlock the app I can't even go back. In this case, I have to close the app & open it again.

Describe the solution you'd like
I want to enable back button functionality when the lock is opened by AppLock.of(context)!.showLockScreen();.

Describe alternatives you've considered
You can even make showLockScreen return an object like Navigator.pop(context, { //... }) has as an optional param which can tell if it was unlocked or closed by back button.

I appreciate your efforts on this wonderful package :)

@tomalabaster
Copy link
Owner

Hi! Thank you for the feedback 🙂

I don't think this is something I want to include in the package.

Could I perhaps direct you to something like (this isn't me endorsing the package, but more offering an alternative) https://pub.dev/packages/back_button_interceptor

You could utilise this on your lock screen to then call AppLock.of(context)!.didUnlock(); in the given callback.

Would you mind explaining the use case for showing the lock screen to the user but allowing them to cancel it?

@tomalabaster tomalabaster added the question Further information is requested label Apr 13, 2024
@avdhootu27
Copy link
Author

avdhootu27 commented Apr 14, 2024

Sure, In my app I have many buttons on a screen which will do various tasks and I want those tasks to be protected, so I am asking to unlock the lock screen if a user clicks on any of the buttons. But there is a high chance that a button is clicked by mistake so I want a back button on the lock screen.

Anyway, I found a way to do that. You can close this issue if you are not going to implement back button.
Thanks.

@tomalabaster
Copy link
Owner

It sounds more like a "cancel" function - which might be something I'd be happy to include...

I'm going to rename the issue and revisit.

@tomalabaster tomalabaster changed the title Feedback for didUnlock Cancel functionality Apr 14, 2024
@tomalabaster tomalabaster added the enhancement New feature or request label Apr 14, 2024
@avdhootu27
Copy link
Author

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants