create<T extends Object?> method
Registers, creates and gets the instance of T
with or without id
given.
Returns it, else return null
.
Implementation
T? create<T extends Object?>({
required ContextBuilder<T> builder,
String? id,
Object? ref,
}) {
register<T>(builder: builder, id: id);
final reactterInstance = _getAndCreateIfNotExtist<T>(id);
if (ref != null) {
reactterInstance?.refs.add(ref.hashCode);
}
return reactterInstance?.instance;
}