setLastEntryIndexOneLess function
Implementation
void setLastEntryIndexOneLess() => getLastEntryIndex() - 1 <
0 // we dont have to be null aware as this fx takes care of the nullability check
? prefs.setDouble("lastEntryIndex", 0)
: prefs.setDouble("lastEntryIndex", getLastEntryIndex() - 1);