findConstraint<T extends ColumnConstraint> method

T? findConstraint<T extends ColumnConstraint>()

Finds a constraint of type T, or null, if none is set.

Implementation

T? findConstraint<T extends ColumnConstraint>() {
  final typedConstraints = constraints.whereType<T>().iterator;
  if (typedConstraints.moveNext()) {
    return typedConstraints.current;
  }
  return null;
}