get<T extends Object?> method
Gets the instance of T
with or without id
given.
If not found and has registered, create a new instance.
If found it, returns it, else returns null
.
Implementation
T? get<T extends Object?>([String? id]) {
return _getAndCreateIfNotExtist<T>(id)?.instance;
}