Session.newSession constructor

Session.newSession(
  1. Map<String, String> data, {
  2. String? id,
  3. DateTime? createdTime,
})

Create new session with given data, id and createdTime

If id is not given, it tries to create a new unique id. If createdTime is not given, it sets the createdTime to current time

Implementation

Session.newSession(Map<String, String> data,
    {String? id, DateTime? createdTime})
    : id = id ?? newId,
      needsUpdate = true,
      createdTime = createdTime ?? new DateTime.now() {
  _data.addAll(data);
}