isClean method
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
attributesis 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);