instanceOf<T extends ManagedObject> method Null safety

T instanceOf<T extends ManagedObject>(
  1. {ManagedBacking? backing}
)

Creates a new instance of this entity's instance type.

By default, the returned object will use a normal value backing map. If backing is non-null, it will be the backing map of the returned object.

Implementation

T instanceOf<T extends ManagedObject>({ManagedBacking? backing}) {
  if (backing != null) {
    return (runtime!.instanceOfImplementation(backing: backing)
      ..entity = this) as T;
  }
  return (runtime!.instanceOfImplementation()..entity = this) as T;
}