isClean method

bool isClean([
  1. Object? attributes
])
inherited

Checks if attributes have NOT been modified since the last sync.

This is the inverse of isDirty.

When attributes is provided, checks if those specific attributes are clean.

  • If a single String is provided, checks that one attribute
  • If a List<String> is provided, checks if all those attributes are clean When attributes is null, checks if all attributes are clean.

Example:

final user = await Users.query().where('id', 1).first();
print(user.isClean()); // true
user.setAttribute('name', 'New Name');
print(user.isClean()); // false
print(user.isClean('email')); // true
print(user.isClean(['email'])); // true

Implementation

bool isClean([Object? attributes]) => !isDirty(attributes);