htFetch method

dynamic htFetch(
  1. String varName
)

Implementation

dynamic htFetch(String varName) {
  switch (varName) {
    case 'toPercentageString':
      return (HTEntity entity,
          {List<dynamic> positionalArgs = const [],
          Map<String, dynamic> namedArgs = const {},
          List<HTType> typeArgs = const []}) {
        final fractionDigits = positionalArgs.first;
        return (this * 100).toStringAsFixed(fractionDigits).toString() +
            HTLocale.current.percentageMark;
      };
    case 'compareTo':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          compareTo(positionalArgs[0]);
    case 'remainder':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          remainder(positionalArgs[0]);
    case 'isNaN':
      return isNaN;
    case 'isNegative':
      return isNegative;
    case 'isInfinite':
      return isInfinite;
    case 'isFinite':
      return isFinite;
    case 'abs':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          abs();
    case 'sign':
      return sign;
    case 'round':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          round();
    case 'floor':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          floor();
    case 'ceil':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          ceil();
    case 'truncate':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          truncate();
    case 'roundToDouble':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          roundToDouble();
    case 'floorToDouble':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          floorToDouble();
    case 'ceilToDouble':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          ceilToDouble();
    case 'truncateToDouble':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          truncateToDouble();
    case 'toInt':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toInt();
    case 'toDouble':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toDouble();
    case 'toStringAsFixed':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toStringAsFixed(positionalArgs[0]);
    case 'toStringAsExponential':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toStringAsExponential(positionalArgs[0]);
    case 'toStringAsPrecision':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toStringAsPrecision(positionalArgs[0]);
    case 'toString':
      return (HTEntity entity,
              {List<dynamic> positionalArgs = const [],
              Map<String, dynamic> namedArgs = const {},
              List<HTType> typeArgs = const []}) =>
          toString();
    default:
      throw HTError.undefined(varName);
  }
}