getOrPut<T extends Object> method
根据Type + key获取,如果不存在则创建信息
Implementation
T getOrPut<T extends Object>(
{Object? key, required T Function(Lifecycle lifecycle) ifAbsent}) {
final lifecycle = _lifecycle?.target;
if (_isDestroyed || lifecycle == null) {
throw Exception('extData has been destroyed.');
}
return _data.putIfAbsent(_genKey<T>(key: key), () => ifAbsent(lifecycle))
as T;
}