evalInstance method

Future<Instance> evalInstance(
  1. String expression, {
  2. required Disposable? isAlive,
  3. Map<String, String>? scope,
})

Eval an expression and immediately obtain its Instance.

Implementation

Future<Instance> evalInstance(
  String expression, {
  required Disposable? isAlive,
  Map<String, String>? scope,
}) {
  return safeGetInstance(
    // This is safe to do because `safeEval` will throw instead of returning `null`
    // when the request is cancelled, so `getInstance` will not receive `null`
    // as parameter.
    safeEval(expression, isAlive: isAlive, scope: scope),
    isAlive,
  );
}