admin管理员组文章数量:1404923
Before implementing flutter_app_lock, the device back button would always return to the previous screen (the one from which it was pushed). With flutter_app_lock, the device back button will close the app entirely (Android) instead, if the second screen called and dismissed any dialog box.
I have established with certainty that this behavior is due to the addition of flutter_app_lock to the app, because when I simply comment-out the following lines and run the app, the back button behaves as expected.
MaterialApp(
...
// builder: (context, child) => AppLock(
// builder: (context, arg) => child!,
// lockScreenBuilder: (context) => LockScreen(),
// initiallyEnabled: (currentAppLockMode > 0), // 0 = no lock, 1 = PIN, 2 = biometrics
// initialBackgroundLockLatency: const Duration(seconds: 5),
// ),
Even if the user opens and closes a dialog in a screen, after the dialog is closed, the screen's own pop() should return to the previous route in the stack and not hide the entire app.
I am developing using:
[√] Flutter (Channel stable, 3.29.1, on Microsoft Windows [Version 10.0.26100.3194], locale en-US)
[√] Windows Version (11 Pro 64-bit, 24H2, 2009)
[√] Android toolchain - develop for Android devices (Android SDK version 35.0.0)
[√] Android Studio (version 2024.3)
[√] VS Code, 64-bit edition (version 1.97.2)
I cannot release this version where the back button closes the app unexpectedly. Is there any fix or workaround for this situation?
本文标签:
版权声明:本文标题:flutter - After implementing flutter_app_lock, the device back button closes the app instead of returning to the previous screen 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1744863345a2629199.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
发表评论