isPercent function

bool isPercent(
  1. dynamic s
)

Check if a String is a percentage value

Implementation

bool isPercent(dynamic s) {
  if (s == null) return false;
  if (s is! String) return false;

  try {
    if (s.endsWith("%")) {
      s = s.split("%")[0];
      return isNumeric(s);
    }
  } catch (e) {
    Log().debug('$e');
  }
  return false;
}