endSession method

Future<void> endSession()

Ends the current session.

Implementation

Future<void> endSession() async {
  if (_startSessionDate != null) {
    int sessionTime = await _totalSessionTime();
    SharedPreferences prefs = await SharedPreferences.getInstance();
    await prefs.setInt(
      'com.mumble.mburger.audience.sessionTime',
      sessionTime,
    );
    _startSessionDate = null;
  }
}