initializeCache<T> method
Initializes the cache if it has not been initialized and returns the
initial value
or an already existing value.
Implementation
T initializeCache<T>(String key, T value) {
final result = cache[key];
if (result is T) {
return result;
}
cache[key] = value;
return value;
}