uniqueValueForField method

  1. @protected
String uniqueValueForField(
  1. String? fieldName, {
  2. required SharedChecker<Model> checker,
})

Provides the value for the SQL lookup. Most often this is simply the field name, but more complex use cases may require a specific property to be called on the class itself.

However, it is strongly, strongly discouraged to use anything more than a primitive for unique values. A complex class with multiple fields and methods will significantly confuse maintenance. A string or int or double is more than sufficient to determine a row's uniqueness.

Implementation

@protected
String uniqueValueForField(String? fieldName, {required SharedChecker checker}) {
  return fieldName ?? '';
}