resolveWithDefault<T> method Null safety

  1. @override
T resolveWithDefault<T>(
  1. int id,
  2. T defaultValue
)

Implementation

@override
T resolveWithDefault<T>(int id, T defaultValue) {
  if (id >= _objects.length) {
    return defaultValue;
  }
  var object = _objects[id];
  if (object is T) {
    return object as T;
  }
  return defaultValue;
}