preloadImage method

Future<void> preloadImage(
  1. String url
)

Download and cache image without displaying (Prefetch)

Implementation

Future<void> preloadImage(String url) async {
  try {
    await cacheManager.downloadFile(url);
    debugPrint('Preloaded image: $url');
  } catch (e) {
    debugPrint('Error preloading image: $e');
  }
}