int current

Get the index of the level the user is currently at

Source

int get current {
    final idx = window.localStorage.containsKey("level") ? int.parse(window.localStorage["level"]) : 0;
    return idx >= size ? size -1 : idx;
}
void current=(int idx)

Update the index of the level the user is currently at. If the level is higher than the unlocked level, the player will unlock it as well.

Source

set current(int idx) {
    idx = (idx >= size ? size -1 : idx);
    window.localStorage["level"] = idx.toString();
    if (idx > unlocked) window.localStorage["unlocked"] = idx.toString();
}