validateSchema method

  1. @override
void validateSchema()
override

Validates runtime schema invariants that cannot rely on debug-only asserts.

Field definitions keep const constructors for ergonomic schema declarations, so the dataset calls this during schema indexing to enforce public field metadata rules in debug and release builds.

Implementation

@override
void validateSchema() {
  super.validateSchema();
  final min = minValue;
  final max = maxValue;
  if (min != null && max != null && min > max) {
    throw ArgumentError.value(
      max,
      'maxValue',
      'FdcIntegerField "$name" maxValue must be greater than or equal to minValue.',
    );
  }
}