Closed
Description
I am very surprised I can't serialize a basic private field, I guess it is by design because as soon as I make it public, it works well.
I have a quite basic use case.
I have a private field storing a global id count, used to generate local id of child objects.
So other object should have access to nextCatId or nextDogId but not _nextId.
And _nextId must be saved and loaded locally in my document-based dababase.
int _nextId = 0;
String get nextCatId => "c${nextId++}";
String get nextDogId => "h${nextId++}";
Any thoughts ?