$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 'length':
      return $int($value.length);
    case 'isEmpty':
      return $bool($value.isEmpty);
    case 'isNotEmpty':
      return $bool($value.isNotEmpty);
    case '+':
      return __concat;
    case '[]':
      return __index;
    case 'codeUnitAt':
      return __codeUnitAt;
    case 'codeUnits':
      return wrapList<int>($value.codeUnits, (e) => $int(e));
    case 'compareTo':
      return __compareTo;
    case 'contains':
      return __contains;
    case 'endsWith':
      return __endsWith;
    case 'indexOf':
      return __indexOf;
    case 'lastIndexOf':
      return __lastIndexOf;
    case 'padLeft':
      return __padLeft;
    case 'padRight':
      return __padRight;
    case 'replaceAll':
      return __replaceAll;
    case 'replaceFirst':
      return __replaceFirst;
    case 'replaceRange':
      return __replaceRange;
    case 'startsWith':
      return __startsWith;
    case 'split':
      return __split;
    case 'substring':
      return __substring;
    case 'toLowerCase':
      return __toLowerCase;
    case 'toUpperCase':
      return __toUpperCase;
    case 'trim':
      return __trim;
    case 'trimLeft':
      return __trimLeft;
    case 'trimRight':
      return __trimRight;
  }

  return _superclass.$getProperty(runtime, identifier);
}