insertEntry function

void insertEntry(
  1. EphemeralTelemetry newEntry
)

Implementation

void insertEntry(EphemeralTelemetry newEntry) {
  prefs.setString(
      "userEntry_EphemeralData${newEntry.entryIndex}",
      jsonEncode(<String, dynamic>{
        "entryIndex": newEntry.entryIndex,
        "moodScale": newEntry.moodScale,
        "briefNote": newEntry.briefNote,
        "hoursOfSleep": newEntry.hoursOfSleep,
        "entryTimeEpochMS": newEntry.entryTimeEpochMS,
        "emotionTags": newEntry.emotionTags,
        "stressorsOfToday": newEntry.stressorsOfToday,
        "hoursOnScreen": newEntry.hoursOnScreen,
        "hoursExercising": newEntry.hoursExercising,
        "howStressed": newEntry.howStressed,
        "hoursSpentWithFamily": newEntry.hoursSpentWithFamily,
        "sleepRating": newEntry.sleepRating,
      }));
  setLastEntryIndexOneMore();
}