verifyRange method

dynamic verifyRange(
  1. String curValue,
  2. String oldValue,
  3. num minValue,
  4. num maxValue,
  5. dynamic call(
    1. String,
    2. bool
    )?,
)
inherited

Verify range.

Implementation

verifyRange(
  String curValue,
  String oldValue,
  num minValue,
  num maxValue,
  Function(String, bool)? call,
) {
  final double? value = double.tryParse(curValue);
  late bool res = false;
  if (value != null) {
    res = value < minValue || value > maxValue;
  }
  final String result = res ? oldValue : curValue;
  call?.call(result, res);
}