Skip to main content

xue_hua_navite_cache_manager 1.3.0 copy "xue_hua_navite_cache_manager: ^1.3.0" to clipboard
xue_hua_navite_cache_manager: ^1.3.0 copied to clipboard

Flutter native network file cache with CachedNetworkImage, HTTP 304 revalidation, LRU/LFU/FIFO/TTL eviction, MD5/SHA-256 checksums, and progress.

1.3.0 #

  • Migrated native platform communication from manual MethodChannel/EventChannel + plugin_platform_interface to Pigeon Native Interop:
    • iOS & macOS (ios/, macos/): Independent Pigeon Swift FFI (useFfi: true) + @FlutterApi progress callbacks via @async listener bindings, eliminating DispatchQueue.main.sync deadlocks on URLSession creation and keeping cancelDownload lock-free from disk I/O.
    • Android (android/): Pigeon Kotlin JNI (useJni: true) with coroutine suspend host handlers and daemon progress dispatching.
    • Windows (windows/) & Linux (linux/): Pigeon C++ and GObject channel handlers generated from pigeons/cache_messages.dart, moving disk/index work onto bounded worker pools and dispatching progress events on platform threads.
    • Dart (lib/): Removed plugin_platform_interface and manual channel boilerplate, introducing an internal CacheBackend interface (PigeonCacheBackend on native platforms, XueHuaNaviteCacheManagerWeb on Web) while preserving 100% public Dart API compatibility.

1.2.0 #

  • Added high-performance borderRadius support (BorderRadiusGeometry?) to CachedNetworkImage. Rounded corners are rendered directly on the canvas via a custom leaf RenderBox (ui.ImageShader + Canvas.drawRRect single-pass GPU draw call with shader caching) without allocating heavyweight ClipRRect / Container widgets, ClipRRectLayer compositing layers, or saveLayer offscreen buffers during fade-in transitions.
  • Fixed CachedNetworkImage.imageBuilder rendering blank (0x0 layout collapse) when returning a childless Container with BoxDecoration(image: DecorationImage(image: imageProvider)):
    • Preserved CachedNetworkImage's width and height constraints on the imageBuilder subtree and added decoded ui.Image intrinsic-dimension LimitedBox fallbacks when placed inside unbounded parents (Column, Row, ListView, SingleChildScrollView).
    • Shared active ImageStreamCompleter instances in CachedNetworkImageProvider while mounted so DecorationImage inside imageBuilder resolves synchronously from the already-decoded frame without duplicate decoding or network requests.
    • Prevented late asynchronous chunkEvents from overriding loadingBuilder after the first frame has decoded, and ensured fade-in animations paint on frame 0 so RenderDecoratedBox resolves DecorationImage immediately.
  • Breaking Change: Renamed CachedNetworkImage.errorWidget to CachedNetworkImage.errorBuilder to align with Flutter's Image.errorBuilder naming convention.

1.1.6 #

  • Example Fetch, preset, and gallery URLs no longer use flutter.github.io or picsum.photos. Android API 24 rejects those certificate chains (CertPathValidatorException: Trust anchor). Default Fetch is https://httpbin.org/image/jpeg, sample images are https://www.gstatic.com/webp/gallery/1.jpg and 2.jpg, the sample video is https://filesamples.com/samples/video/mp4/sample_640x360.mp4, and the other gallery slots are distinct https://placehold.co/ JPEGs.
  • Expanded example integration_test coverage, silenced avoid_print in the driver entrypoint, and disabled the Xcode quoted-include warning in the example iOS project.
  • Restored Android background-executor delivery for clearAll / trimToSize / removeByTag / removeExpired / removeFile / listEntries / getStats so it matches the 1.1.5 pub.dev build (main had drifted after the 1.1.5–1.1.10 collapse).

1.1.5 #

  • Aggregates unpublished work since 1.1.4.
  • Fixed iOS simulator Fetch after the download itself succeeds. 1.1.9 capped TLS at 1.2, so CFNetwork finishes the owl GET (HTTP/2, status 200). The example still never showed Last Fetch Result: the simulator session had an empty URLSessionDelegate, and URLSession.data(for:) resumes only through that delegate. The anchor implements no task callbacks, so the async continuation never ran, finishNetworkDownload / finishInFlight never ran, and the main-queue FlutterResult was never posted. The driver poll (~45s) also ends before the 46s watchdog, which is why Download error did not appear either. The simulator now uses a delegate-free dataTask completion handler. That handler is what URLSession calls when the task finishes; it hops to the download queue, finishNetworkDownload stores the file, and finishInFlight runs the waiter, which calls FlutterResult on the main thread. Device downloads still use the delegate downloadTask. macOS and Windows are unchanged.
  • Fixed iOS simulator Fetch so the example can show Last Fetch Result. assumesHTTP3Capable = false does not disable HTTP/3 (it is the default), so the iOS 27 simulator still tried QUIC and the download never finished. downloadTask completion handlers and didCompleteWithError were both silent, so downloadFile never replied. The simulator session now caps TLS at 1.2 (HTTP/1.1 only) and loads the body with URLSession.data(for:) on an explicit serial delegate queue. finishNetworkDownload then posts FlutterResult on the main queue, which is what the example turns into Last Fetch Result (or Download error). Devices still stream with a delegate downloadTask. macOS is unchanged.
  • Fixed iOS compilation. The main.async closure that starts the first download used optional chaining (self?.resumeDownloadTask), so its type was () -> ()? and DispatchQueue.async(execute:) selected the DispatchWorkItem overload. The hop is now a Void closure. The 1.1.7 download-completion behavior is unchanged.
  • Fixed iOS simulator downloadFile never completing. Delegate-based URLSessionDownloadTask did not deliver didCompleteWithError on the simulator (macOS on the same commit did), and the watchdog called task.cancel() before scheduling its fallback, so a stuck session queue swallowed the timeout. iOS now uses a completion-handler download task, creates the first URLSession on the main thread without DispatchQueue.main.sync, and on the simulator uses an ephemeral session with HTTP/3 disabled so the request is not stuck in the simulator HTTP stack.
  • Fixed Darwin plugin compilation. permitKeys was initialized with a dictionary literal ([:]), which Swift cannot use for Set<String>. Both iOS and macOS now use an empty set ([]), so the 1.1.5 plugins build again.
  • Fixed Darwin flutter_driver stalls after the example gallery scrolls. flutter_driver waitFor does not search until transientCallbackCount is 0. The gallery's indeterminate CircularProgressIndicator (no Content-Length yet) and the status banner's indeterminate LinearProgressIndicator (latest event started / failed / canceled) never stop ticking, so every later tapText hit the 20s command timeout while the isolate itself stayed alive. Loading placeholders are now static unless byte progress is known, and the banner never passes a null progress value.
  • Fixed iOS URLSession startup. The session was first created on a GCD worker inside downloadFile; CFNetwork can abort the process from that thread, which matches the simulator fetch dying before Last Fetch Result and the Dart VM restarting. The session is now created on the main thread, with waitsForConnectivity = false, explicit request/resource timeouts, and a background delegate queue.
  • Darwin downloads stream to disk with URLSessionDownloadTask instead of buffering the whole body in a dataTask. Progress events are throttled to 50ms and include the expected byte count. A watchdog cancels a task that never completes and releases its download permit exactly once. Nil fields are omitted from event and download payloads so the iOS codec does not see NSNull.
  • iOS index load now recovers orphaned cache files when cache_index_v1.json is missing, matching macOS, and ignores in-flight .partial downloads.

1.1.4 #

  • Fixed Windows platform-thread delivery for the event channel and download method results. EventSink and MethodResult are no longer invoked from WinHTTP worker threads. Flutter 3.50 and newer SDKs use PluginRegistrarWindows::PostPlatformThreadTask when that API is present; earlier 3.47+ SDKs post to a message-only window created on the platform thread, which is the thread the engine requires.
  • Throttled Windows inProgress events to one per 50ms so gallery downloads do not flood the platform thread.
  • Windows cache-index writes are now debounced (600ms) and flushed off the platform thread, matching the documented 10,000-entry index engine, so the example stress benchmark does not rewrite the full index on every putBytes.
  • Replaced deprecated package:flutter/material.dart imports with package:material_ui/material_ui.dart (material_ui: ^1.0.0) so root flutter analyze is clean on Flutter 3.47+.

1.1.3 #

  • Corrected the example integration test checksum expectation for the loopback payload.
  • Added an example flutter_driver UI harness under example/test_driver/.
  • Fixed Linux conditional HTTP revalidation. Downloads now store ETag and Last-Modified, and an HTTP 304 Not Modified response is reported as revalidated instead of another networkDownload.

1.1.2 #

  • Shortened the pubspec description so it meets pub.dev's 60–180 character guidance and search engines can show the full text.

1.1.1 #

  • Fixed Windows CMakeLists.txt native-test gate: if(FALSE AND ${include_..._tests}) expanded to invalid if(FALSE AND) when the variable was unset, breaking host app flutter build windows.

1.1.0 #

  • Added a bounded native download concurrency pool controlled by maxConcurrentDownloads across Android, iOS, macOS, Windows, Linux, and Web, so large batches (e.g. 100+ images) stay controlled instead of flooding the network stack.
  • Reworked iOS/macOS downloads to pure async URLSession completion callbacks with a download permit queue (removed blocking semaphore.wait() on GCD workers).
  • Made prefetchAll run through the same bounded concurrent pool on every platform instead of serial one-by-one downloads.
  • Added in-flight request deduplication by cache key on native platforms and in Dart downloadFile, so concurrent callers for the same URL/key share one network transfer and fan out one result.
  • Moved Windows WinHTTP and Linux curl downloads onto background worker threads so MethodChannel / UI threads are no longer blocked during transfers.
  • Fixed Windows cancelDownload so custom keys that are still only in the in-flight table (not yet indexed) can be canceled, matching Linux/Apple/Android behavior.
  • Added CachedNetworkImage widget and CachedNetworkImageProvider for high-performance, zero-jank 60/120 FPS network image rendering and caching across all 6 platforms.
  • Implemented zero-copy native file decoding (ui.ImmutableBuffer.fromFilePath) and C++ codec target-size downsampling (memCacheWidth, memCacheHeight, maxWidth, maxHeight) to prevent GPU/RAM spikes on high-resolution images.
  • Added synchronous ImageCache fast-path short-circuiting (wasSynchronouslyLoaded) to eliminate fade-in flicker during rapid list/grid scrolling.
  • Upgraded cache index engine across Android, iOS, macOS, Windows, Linux, and Web to support 10,000+ cached entries (maxEntries default raised to 20,000) with O(1) running byte quota tracking, 600ms debounced asynchronous disk flushing, and 50ms progress event throttling.
  • Split data models and enums into dedicated modular files under lib/src/models/.
  • Added a 5-tab example workbench featuring a CachedNetworkImage gallery and a 10,000+ entries stress benchmark, along with comprehensive unit, widget, and performance test suites.

1.0.0 #

  • Initial stable release of xue_hua_navite_cache_manager across Android, iOS, macOS, Windows, Linux, and Web.
  • Added XueHuaNaviteCacheManager.instance unified API with global configuration (CacheManagerConfig).
  • Added network file downloading and caching (downloadFile, getSingleFile, prefetch, prefetchAll, cancelDownload) with conditional HTTP ETag / Last-Modified (304 Not Modified) revalidation and Cache-Control: max-age parsing.
  • Added native MD5 and SHA-256 checksum verification (CacheChecksumAlgorithm).
  • Added configurable disk quota eviction policies (LRU, LFU, FIFO, TTL-only) and pinned entry protection (setPinned).
  • Added manual cache insertion and reading (putBytes, putFile, getFileFromCache, readCacheBytes, containsKey).
  • Added selective and bulk eviction (removeFile, removeByTag, removeExpired, trimToSize, clearAll) and real-time analytics (getStats, listEntries, getCapabilities, progressStream, watchProgress).
0
likes
160
points
990
downloads

Documentation

API reference

Publisher

verified publisherjsontodart.cn

Weekly Downloads

Flutter native network file cache with CachedNetworkImage, HTTP 304 revalidation, LRU/LFU/FIFO/TTL eviction, MD5/SHA-256 checksums, and progress.

Repository (GitHub)
View/report issues

Topics

#cache #network #download #storage #file-cache

License

Apache-2.0 (license)

Dependencies

ffi, flutter, flutter_web_plugins, jni, material_ui, meta, objective_c, web

More

Packages that depend on xue_hua_navite_cache_manager

Packages that implement xue_hua_navite_cache_manager