Comments (2)
SessionTimeoutState.userInactivityTimeout event keep calling even when user is interact with the app.
I have implemented the code on home screen , when i'm on home screen and home screen is idle for 10 seconds then this works fine . but when i'm on other screen and keep interacting with the app it sends back me to pin screen . Here is my code
handleLocalSession(seconds: 10);
handleLocalSession({int? seconds}) {
sessionConfig = SessionConfig(
invalidateSessionForAppLostFocus: Duration(seconds: seconds!),
invalidateSessionForUserInactivity: Duration(seconds: seconds));
sessionConfig.stream.listen((SessionTimeoutState timeoutEvent) {
sessionStateStream.add(SessionState.stopListening);
if (timeoutEvent == SessionTimeoutState.userInactivityTimeout) {
// handle user inactive timeout
log("userInactivityTimeout ");
Get.toNamed(PageRoutes.pinScreen);
} else if (timeoutEvent == SessionTimeoutState.appFocusTimeout) {
// handle user app lost focus timeout
log("appFocusTimeout ");
Get.toNamed(PageRoutes.pinScreen);
}
});
}
from local_session_timeout.
Default value of userActivityDebounceDuration
is 10 seconds which means it records only one user event for 10 seconds (to prevent memory leaks because of setTimeout objects), you can change this value to a lower number like 1 or 2 seconds. You can pass it as a parameter to SessionTimeoutManager
from local_session_timeout.
Related Issues (20)
- Localizations Delegate HOT 11
- Not getting it to work HOT 18
- timeoutEvent == SessionTimeoutState.userInactivityTimeout HOT 16
- setState is being called on a deactivated widget
- suggestion HOT 1
- sessionStateStream.add(SessionState.startListening); causes screen navigation issues HOT 4
- Handle SessionTimeoutManager.sessionConfig change HOT 2
- Irregular Session State Stream behaviour HOT 1
- Session manager times out on auth screen HOT 3
- Need login twice when using easy_localization HOT 5
- Flutter Web: SessionTimeoutState.userInactivityTimeout event keep calling even when user interacts with the app HOT 3
- Timeout event is not firing when duration set to 8 hours and app is in background HOT 10
- sessionStateStream issue with Getx HOT 19
- Warning alert with timer reducing before logout HOT 7
- Does not work a screen that has movement activity HOT 2
- Events are not firing on Samsung S23 Android 14 device HOT 3
- invalidateSessionForAppLostFocus not working when screen is closed - Android 13 HOT 10
- SessionTimeoutState.userInactivityTimeout event keep calling even when user is interact with the app . HOT 3
- ForeGround Timer Not Working Properly HOT 8
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from local_session_timeout.