lock method

bool lock(
  1. WireDataLockToken token
)

Prevent any value modifications inside specific of WireData instance. WireDataLockToken token should be stored in some controller or responsible for modification entity. The purpose of this method is to restrict data changes only to the place where business logic or model related operations take place.

Implementation

bool lock(WireDataLockToken token) {
  final locked = !isLocked || _lockToken!.equal(token);
  if (locked) _lockToken = token;
  return locked; // throw ERROR__DATA_ALREADY_CLOSED
}