session property

TSession get session

Gets the session data for this context.

Throws StateError if no session plugin is installed.

Implementation

TSession get session {
  final sessionData = get<TSession>(SessionPlugin._sessionProperty);
  if (sessionData == null) {
    throw StateError(
      'Session not available. Make sure SessionPlugin is installed.',
    );
  }
  return sessionData;
}
set session (TSession value)

Sets the session data for this context.

Automatically saved when update processing completes.

Implementation

set session(TSession value) {
  set<TSession>(SessionPlugin._sessionProperty, value);
}