onWrite method
Whenever a lua object's fields or value is modified (written),
executes callback. If the lua object's storage is value, then
the first argument of callback will be 'self'. Otherwise it is
the string name of the field's key.
Implementation
void onWrite(Function(String, Object?)? callback) => _onWrite = callback;