buildCachedView<T> method
Returns a cached view if the cache key matches.
Implementation
@protected
T buildCachedView<T>(T Function() builder, Object? cacheKey) {
if (_cachedView != null && _cachedViewKey == cacheKey) {
return _cachedView as T;
}
final result = builder();
_cachedView = result;
_cachedViewKey = cacheKey;
return result;
}