$getProperty method

  1. @override
$Value? $getProperty(
  1. Runtime runtime,
  2. String identifier
)
override

Get a property by identifier on this instance

Implementation

@override
$Value? $getProperty(Runtime runtime, String identifier) {
  switch (identifier) {
    case 'inDays':
      return $int($value.inDays);
    case 'inHours':
      return $int($value.inHours);
    case 'inMinutes':
      return $int($value.inMinutes);
    case 'inSeconds':
      return $int($value.inSeconds);
    case 'inMilliseconds':
      return $int($value.inMilliseconds);
    case 'inMicroseconds':
      return $int($value.inMicroseconds);
    case 'compareTo':
      return $Function(_compareTo);
    case 'isNegative':
      return $bool($value.isNegative);
    case 'abs':
      return $Function(_abs);
    case '<':
      return $Function(_lessThan);
    case '<=':
      return $Function(_lessThanOrEqual);
    case '>':
      return $Function(_greaterThan);
    case '>=':
      return $Function(_greaterThanOrEqual);
  }
  return _superclass.$getProperty(runtime, identifier);
}