like library
Link Intelligent Kernel Engine (LIKE) - A high-performance, 4-tier caching networking package for Flutter.
Classes
- AppCacheManager
-
Persistent image cache manager backed by
flutter_cache_manager. - AppCacheUtils
- Utilities for normalizing image cache URLs and keys.
- CancelToken
-
Controls cancellation of
Dio's requests. - DefaultLikeReplayCodec
- Snapshots multipart bytes so replay does not depend on a temporary file path.
- DefaultLikeUnpacker
- The default unpacker, assuming a "flat" structure or a common "data" wrapper.
- JsonParse
- Comprehensive utility class for safe JSON field parsing.
- Like
- Like
-
LikeApiResult<
T> - LikeARS
- LikeAuthConfig
- Configuration for authentication token providers, refresh handlers, and logout callbacks.
- LikeAuthInterceptor
- Interceptor to handle authentication tokens, 401 token refresh, and 429 rate limiting. Matches enterprise's AuthInterceptor parity.
- LikeBaseApiService
-
LikeBuilder<
T> -
LikeBuilder<T> - LikeCacheImage
- LikeCacheImage
- LikeClient
- The central entry point for all network requests in the LIKE engine.
- LikeClientConfig
- Configuration for creating an isolated, scoped LikeClient instance.
- LikeConfig
- Global configuration for the LIKE engine's behavior and caching system.
- LikeConnectivityCheckResult
- Structured snapshot produced by a LIKE connectivity check.
- LikeConnectivityTransition
- Describes a meaningful reachability transition for one canonical API origin.
- LikeConstants
- Centralized configuration and constants for the LIKE networking engine. Provides production-grade networking configuration parity.
- LikeDataUnpacker
- Defines how raw API responses (envelopes) are parsed and mapped.
- LikeDiagnostics
- LikeError
- A unified error model for all network operations. Matches the exact logic and contract of enterprise's ApiError.
- LikeErrorHandler
- Handles conversion of various errors (Dio, Socket, etc.) into unified LikeError. Matches the exact categorization and user-friendly messaging logic of enterprise's ErrorHandler.
- LikeHttpClient
- Injectable HTTP boundary for services. Implement or mock this contract in unit tests without initializing Hive, connectivity, or the default client. Implementations own their lifecycle; services never dispose injected clients.
- LikeInfiniteScroll
-
LikeInfiniteScroll - LikeInvalidationEvent
- LikeInvalidationHub
- Application data events only: no payloads, credentials or diagnostic logging.
- LikeLogger
- Professional logging service for the LIKE networking engine. Supports disk logging, tiered console levels, and api event tracking. Matches the exact logic and feature set of enterprise's LoggerService.
- LikeMockInterceptor
- LikeMockScenario
- Versioned, persistent scenarios use synthetic payloads only. Safe export strips matching credentials and opaque response values before sharing with others.
- LikeNetworkQualityInterceptor
- Measures real HTTP attempts using a monotonic clock; ignores cached results, cancellations and local failures. Works without browser-specific APIs.
- LikeNetworkQualityMonitor
- Instance-owned monitor; inject it for deterministic tests and scoped clients.
- LikeNetworkQualitySample
- Passive API-path measurements, not a device-wide internet speed test.
- LikeOfflineTask
- Metadata-only queue view. Bodies and credentials are deliberately excluded.
-
LikeOptimisticStore<
T> - Ordered optimistic layers prevent an older rollback from overwriting a newer successful mutation. Reconciliation reducers should merge server entities by ID.
-
LikePagedQuery<
T> - Page storage remains separate from the de-duplicated view, so replacing a page cannot shift another page's offsets. Failed pages retain their cursor for retry.
-
LikePageSnapshot<
T> -
LikePaginatedResponse<
T> - Immutable paginated state snapshot that can be managed by any state management solution (Provider, Riverpod, BLoC/Cubit, GetX, MobX, or LikeChangeNotifier).
-
LikeQuery<
T> - Framework-independent query lifecycle shared by every presentation adapter.
-
LikeQueryNotifier<
T> - Provider/ValueListenable adapter. The owner chooses whether it owns the query.
- LikeRedaction
- Sanitizes diagnostic copies only; application responses are never modified.
- LikeReplayCodec
- LikeRequestConfig
- Per-request network configuration overrides for the LIKE engine.
- LikeRequestTrace
- Deliberately has no URL path/query, headers, bodies, error text or credentials.
- LikeResourceIndex
- LikeRetryPolicy
- Bounded positive jitter: never retry before the server's requested minimum.
- LikeService
- Low-level service for interacting with LIKE's persistent Hive boxes. Handles caching, ETags, and the offline queue. Matches enterprise's NetworkBoxService parity.
- LikeSessionIdentity
- Shared cache identity used by L1, persistent cache and ETags.
- LikeSessionInterceptor
- Rejects stale requests before they can acquire another session's credentials.
- LikeSessionScope
- Stable identity supplied by the application after authentication. Never use an access token as accountId: tokens rotate independently of users.
-
LikeSliverBuilder<
T extends Object> -
LikeSliverBuilder<T> -
LikeStateResponse<
T> - The State Engine of the LIKE package. Manages the lifecycle of a request, including SWR and background refreshes.
- LikeToastConfig
- Configuration for user toast/notification callbacks in the LIKE network engine.
- LikeTraceCaptureInterceptor
- LikeTraceContext
- Mutable operation-local metadata only. It is never persisted or exported.
- LikeUnpackedResponse
- A standardized container for unpacked API data.
- LikeWebSocketClient
- Managed WebSocket client for the LIKE package.
-
LikeWhen<
T> -
LikeWhen<T> - MockController
- MockRule
- MultipartBytesFile
- Represents a file to be uploaded as byte data in a multipart request.
-
PaginationTool<
T> - Generic state, parsing, and calculations for page-based and cursor-based pagination.
-
Response<
T> - The Response class contains the payload (could be transformed) that respond from the request, and other information of the response.
Enums
- LikeApiErrorType
- High-level error types for the LIKE networking layer. Matches enterprise's ApiErrorType 1:1.
- LikeConnectivityCheckReason
- Describes why a connectivity check was started.
- LikeLogLevel
- LikeMockFailure
- LikeNetworkQuality
- LikeOfflineTaskStatus
- LikeResponseSource
- LikeState
- Represents the possible states of a network request or data stream.
- LikeStorageStatus
- Diagnostic status of LIKE's persistent Hive storage backend.
- LikeSyncPriority
- Priority levels for background synchronization.
- LikeTracePhase
Mixins
- LikeChangeNotifier
- Lightweight ChangeNotifier mixin for individual request execution.
-
LikeScreenMixin<
T extends StatefulWidget> - Unified screen-level State mixin combining route/tab visibility tracking with connectivity and origin-reachability callbacks.
- LikeStateMixin
- A mixin that provides automatic reconnection, data pipeline binding, and state management for Notifiers.
Extensions
-
ApiResultFutureX
on Future<
ApiResult< Response> > - Extension to reduce boilerplate in repositories when dealing with Futures of results.
- LikeDateTimeExtension on DateTime
- DateTime extension utilities available on non-nullable DateTime.
- LikeNumExtension on num?
-
Null-safe Number extension utilities available on both
numandnum?. -
LikeStateResponseExtension
on LikeStateResponse<
T> - LikeStringExtension on String?
-
Null-safe String extension utilities available on both
StringandString?.
Properties
-
likeRouteObserver
→ RouteObserver<
ModalRoute< void> > -
Global route observer for LikeScreenMixin.
Must be added to
MaterialApp.navigatorObservers.final
Functions
-
jsonMap(
Object? value) → Map< String, dynamic> -
Helper function to safely cast/convert dynamic value to
Map<String, dynamic>. -
likeWhenNotifier<
T extends Object> ({required LikeStateResponse response, Future< void> onSuccess(T data)?, Future<void> onError(LikeError error)?, Future<void> onException(String message)?, Future<void> onInit(LikeState state)?}) → Future<void> -
likeWhenNotifier<T> -
updateNotifier<
T extends Object> ({required LikeStateResponse response, BuildContext? context, Future< void> onInit(LikeState state)?, Future<void> onSuccess(T data)?, Future<void> onError(LikeError error)?, Future<void> onException(String message)?, bool enableHaptics = true}) → Future<void> -
updateNotifier<T>
Typedefs
-
ApiResult<
T> = LikeApiResult< T> - Generic result wrapper for API responses. Note: Both 200 OK and 304 Not Modified are considered success states.
- ARS = LikeARS
- Advanced Request Settings (ARS) for fine-grained network control. Mirrors the core enterprise network capabilities.
- BaseApiService = LikeBaseApiService
-
LikeModelFactory<
T> = T Function(dynamic json) - Function signature for creating models from JSON.
-
Pagination<
T> = PaginationTool< T> - Backward compatibility alias for PaginationTool.
- StateMixin = LikeStateMixin
- Shorter alias for LikeStateMixin.
-
StateResponse<
T> = LikeStateResponse< T> - A shorter, cleaner alias for LikeStateResponse.
- States = LikeState
- A shorter, cleaner alias for LikeState.