Comments (11)
Can you post a minimal example to reproduce it if possible
i think i need some time on this. Will come back to you once i finished the minimal example. Thanks.
from local_session_timeout.
Hi,
you are referring to add in this line right?
_signInBloc.state.sessionStateStream.add(SessionState.stopListening);
from local_session_timeout.
Hi,
you are referring to add in this line right?
_signInBloc.state.sessionStateStream.add(SessionState.stopListening);
Yes this line. Other than this line, i also have a page which login page whenever they press login i will start listen
_signInBloc.state.sessionStateStream.add(SessionState.startListening);
Same thing happen when they press the login button which it will start listening
from local_session_timeout.
Can you post the code related to AuthBloc? (Onlythe state definition of the bloc)
from local_session_timeout.
Can you post the code related to AuthBloc? (Onlythe state definition of the bloc)
// ignore_for_file: public_member_api_docs, sort_constructors_first
part of 'auth_bloc.dart';
class AuthState extends Equatable {
final LoadingStatus status;
final CustomErr err;
final StreamController<SessionState> sessionStateStream;
final bool sessionExpired;
AuthState({
required this.status,
required this.err,
required this.user,
required this.sessionStateStream,
required this.sessionExpired,
});
factory AuthState.initial() {
return AuthState(
sessionStateStream: StreamController<SessionState>(),
sessionExpired: false,
status: LoadingStatus.initial,
err: CustomErr(errMsg: '')
);
}
@override
List<Object> get props => [status];
@override
bool get stringify => true;
AuthState copyWith({
LoadingStatus? status,
CustomErr? err,
StreamController<SessionState>? sessionStateStream,
SessionConfig? sessionConfig,
bool? sessionExpired,
}) {
return AuthState(
status: status ?? this.status,
err: err ?? this.err,
sessionStateStream: sessionStateStream ?? this.sessionStateStream,
sessionExpired: sessionExpired ?? this.sessionExpired,
);
}
}
from local_session_timeout.
Little unusual that it goes away after Applocalizations is commented.
While AppLocalizations is not commented, did you notice rebuilds for MaterialApp at any other point (other than sessionStream.add)
from local_session_timeout.
Little unusual that it goes away after Applocalizations is commented.
While AppLocalizations is not commented, did you notice rebuilds for MaterialApp at any other point (other than sessionStream.add)
Everything just working fine actually only until the point i click on the login button which trigger
context.read<AuthBloc>().state.sessionStateStream.add(SessionState.startListening);
then it rebuild but it doesn't happen after i comment out AppLocalizations(). Its really kind a weird, i try to move SessionTimeoutManager to the Login Page, it works without comment AppLocalizations(), but then it is not at the top of the widget tree, so whenever i pushNamed, it cant detect user activity anymore, so i have no choice to put at MaterialApp().
I tried it without using bloc and the result is still the same.
from local_session_timeout.
Can you post a minimal example to reproduce it if possible
from local_session_timeout.
@peter910921 let me know if you need any help to create the minimal example
from local_session_timeout.
@SankethBK Hi sorry for the late reply, been busy on my work.
Actually i think i end up changing my app localizations delegates by following the flutter official guide. After that all working fine now.
https://docs.flutter.dev/development/accessibility-and-localization/internationalization
localizationsDelegates: [
AppLocalizations.delegate,
GlobalCupertinoLocalizations.delegate,
GlobalMaterialLocalizations.delegate,
GlobalWidgetsLocalizations.delegate
],
from local_session_timeout.
Cool
from local_session_timeout.
Related Issues (20)
- Not getting it to work HOT 18
- timeoutEvent == SessionTimeoutState.userInactivityTimeout HOT 16
- SessionTimeoutState.userInactivityTimeout event keep calling even when user is interact with the app . HOT 2
- 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.