cableLength static method

String? cableLength(
  1. String? value
)

Validates cable length (must be positive)

Implementation

static String? cableLength(String? value) {
  final error = positiveNumber(value);
  if (error != null) return error;

  final length = double.parse(value!);
  if (length > 1000) {
    return 'Longitud muy grande (máx. 1000m)';
  }

  return null;
}