utils/session_logic library
Session logic for InnerPod. Copyright (C) 2024, Togaware Pty Ltd
Licensed under the GNU General Public License, Version 3 (the "License");
License: https://opensource.org/license/gpl-3-0
Authors: Amogh Hosamane
Functions
-
addSession(
String? currentContent, Map< String, dynamic> newSession) → String - Adds a new session to the existing TTL content. If currentContent is null or empty, initializes with prefixes. Returns the updated TTL content string.
-
deleteSession(
String currentContent, String startTime) → String - Deletes a session with the given start time from the TTL content.
-
parseSessions(
String? content) → List< Map< String, String> > - Parses a TTL string containing session data into a list of maps. Returns a list of sessions, where each session is a map with 'start', 'end', 'type', 'silenceDuration', 'title', and 'description' keys.
-
serializeSessions(
List< Map< sessions) → StringString, String> > - Serializes a list of sessions into a TTL string.
-
updateSession(
String currentContent, String startTime, Map< String, dynamic> updatedData) → String - Updates a session with the given start time in the TTL content.