get<T extends Object?> method
Creates and/or gets the instance of T
with an id
optional.
Under the following conditions:
- if found it, returns it.
- if not found and has registered it, creates and returns it.
- else returns
null
.
Implementation
T? get<T extends Object?>([String? id, Object? ref]) {
return _getOrCreateIfNotExtist<T>(id, ref)?.instance;
}