convert one instance of State to a JSON to be saved into the storage
State
IMPORTANT if this method returns null the current state saved won't be modified
null
Map<String, dynamic>? toJson(State state);