isGreater static method

bool isGreater(
  1. dynamic value1,
  2. dynamic value2
)

Checks if first value is greater than the second one. The operation can be performed over numbers or strings.

  • value1 the first value to compare
  • value2 the second value to compare Returns true if the first value is greater than second and false otherwise.

Implementation

static bool isGreater(dynamic value1, dynamic value2) {
  var number1 = DoubleConverter.toNullableDouble(value1);
  var number2 = DoubleConverter.toNullableDouble(value2);

  if (number1 == null || number2 == null) return false;

  return number1 > number2;
}