markForegrounded static method
SessionState?
markForegrounded({
- required SessionState? state,
- required int now,
- int backgroundSessionTimeout = 0,
Implementation
static SessionState? markForegrounded({
required SessionState? state,
required int now,
int backgroundSessionTimeout = 0,
}) {
if (state == null) {
return state;
}
if (shouldRotateOnResume(
state,
now,
backgroundSessionTimeout: backgroundSessionTimeout,
)) {
return state;
}
return state.copyWith(
lastActivityAt: now,
clearBackgroundedAt: true,
);
}