sync method
There are some weird cases where collections aren't synced properly with the underlying json. This will overwrite the json with the latest value of the variable.
Implementation
void sync([Set<String>? fields]) {
fields ??= this.mfields;
fields.forEach((f) {
final v = this[f];
if (v is Iterable || v is Map) {
this[f] = v;
}
});
}