memberGet method

  1. @override
dynamic memberGet(
  1. String id, {
  2. String? from,
  3. bool isRecursive = false,
  4. bool ignoreUndefined = false,
})
override

Fetch a member by the id, in the form of

object.id

id must be of String type.

Implementation

@override
dynamic memberGet(String id,
    {String? from, bool isRecursive = false, bool ignoreUndefined = false}) {
  switch (id) {
    case 'BigInt.zero':
      return BigInt.zero;
    case 'BigInt.one':
      return BigInt.one;
    case 'BigInt.two':
      return BigInt.two;
    case 'BigInt.parse':
      return ({positionalArgs, namedArgs}) =>
          BigInt.tryParse(positionalArgs.first, radix: namedArgs['radix']);
    case 'BigInt.from':
      return ({positionalArgs, namedArgs}) =>
          BigInt.from(positionalArgs.first);
    default:
      if (!ignoreUndefined) throw HTError.undefined(id);
  }
}