like library

Link Intelligent Kernel Engine (LIKE) - A high-performance, 4-tier caching networking package for Flutter.

Classes

AppCacheManager
AppCacheSecurity
Handles AES-CBC encryption/decryption for the image cache.
AppCacheUtils
CancelToken
Controls cancellation of Dio's requests.
DefaultLikeToastDelegate
The default implementation of LikeToastDelegate using standard Material widgets.
DefaultLikeUnpacker
The default unpacker, assuming a "flat" structure or a common "data" wrapper.
EncryptedFileServiceResponse
EncryptedHttpFileService
Like
The top-level wrapper for applications using the LIKE networking package. Handles initialization of connectivity monitoring, persistent storage, background synchronization, and authentication interceptors.
LikeAdHocSyncTask
A concrete implementation of LikeSyncTask that allows defining the work via an inline function or callback.
LikeApiResult<T>
Generic result wrapper for API responses. Note: Both 200 OK and 304 Not Modified are considered success states.
LikeARS
LikeAuthInterceptor
Interceptor to handle authentication tokens, 401 token refresh, and 429 rate limiting. Matches enterprise's AuthInterceptor parity.
LikeBuilder<T>
A state management builder widget that handles LikeStateResponse with SWR (stale-while-revalidate) support. Matches the exact signature of the original StateBuilder for seamless integration.
LikeCacheImage
A universal network image widget powered by LIKE's AppCacheManager. It seamlessly integrates the encrypted L2 disk cache and honors LIKE's caching constraints.
LikeCacheInterceptor
Interceptor that persists successful GET responses to the L2 Hive cache. Matches enterprise's CacheInterceptor parity.
LikeClient
The central entry point for all network requests in the LIKE engine.
LikeClientFactory
Factory to create and configure a Dio instance with all LIKE interceptors. Matches enterprise's DioFactory parity.
LikeConfig
Global configuration for the LIKE engine's behavior and caching system.
LikeConnectivityManager
Service to monitor network connectivity and server availability. Matches the exact logic and contract of enterprise's ConnectivityService.
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.
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.
LikeEtagInterceptor
Interceptor to handle HTTP ETag (Entity Tag) caching. Matches enterprise's ETagInterceptor parity.
LikeEvent<T>
A typed event emitted by the LikePipeline. Carries both the raw Response and potentially a ready-to-use mapped model.
LikeHelpers
Central helper utilities for the LIKE networking engine. Matches enterprise's ApiHelpers and NetworkUtils parity.
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.
LikeLoggerInterceptor
Interceptor to log all API requests and responses to console and disk. Matches enterprise's LoggerInterceptor parity.
LikeMockInterceptor
LikeMultiBuilder
A builder that observes multiple LikeStateResponses and aggregates their states. It waits for all states to resolve before calling onSuccess. Matches the exact signature of the original MultiStateBuilder.
LikeMultipartFile
Model for raw bytes multipart files.
LikeMultiSliverBuilder
A sliver builder that observes multiple LikeStateResponses and aggregates their states. Similar to LikeMultiBuilder, but designed to work within a CustomScrollView. Matches the exact signature of the original MultiStateBuilderSliver.
LikeNotifierState<T>
A class that encapsulates a LikeStateResponse and its associated CancelToken.
LikeOfflineSyncInterceptor
Interceptor that queues mutation requests (POST, PUT, DELETE, PATCH) when offline. Matches enterprise's OfflineSyncInterceptor parity.
LikeOfflineSyncManager
Orchestrates synchronization when connectivity is restored. Bridge between LikeConnectivityManager and LikeClient.
LikePerformanceInterceptor
Interceptor to track request performance. Matches enterprise's PerformanceInterceptor parity.
LikePipeline
A reactive event bus for the LIKE networking engine. Broadcasts successful network events (including cache and SWR) to observers. Matches enterprise's NetworkPipeline parity.
LikePipelineInterceptor
Interceptor to automatically emit successful responses to the LikePipeline. Matches enterprise's PipelineInterceptor parity.
LikeRequestRegistry
Registry to track in-flight requests and session-stale keys (L1 Memory Cache). Matches enterprise's RequestRegistry parity.
LikeRetryInterceptor
Intelligent retry interceptor with connectivity awareness. Matches enterprise's AppRetryInterceptor parity.
LikeSelector<N, T>
A specialized version of LikeBuilder that integrates with the Selector pattern from the provider package.
LikeSelectorSliver<N, T extends Object>
A specialized sliver version of LikeSelector for use in CustomScrollView. Matches the exact signature of the original StateSelectorSliver.
LikeService
Low-level service for interacting with LIKE's persistent Hive boxes. Handles caching, ETags, and the offline queue. Matches enterprise's NetworkBoxService parity.
LikeSliverBuilder<T extends Object>
A sliver version of LikeBuilder for rendering states in a CustomScrollView. Handles LikeStateResponse and provides sticky data support for slivers. Matches the exact signature of the original StateBuilderSliver.
LikeStateResponse<T>
The State Engine of the LIKE package. Manages the lifecycle of a request, including SWR and background refreshes.
LikeStateResponseBuilder<T>
A specialized version of LikeBuilder that takes a LikeStateResponse directly. Useful when you already have the response object (e.g. from a Stream or local variable).
LikeStateResponseBuilderSliver<T extends Object>
A specialized version of LikeSliverBuilder that takes a LikeStateResponse directly. Useful when you already have the response object and need to render slivers.
LikeSyncEvent
Represents a synchronization event broadcasted after a successful mutation.
LikeSyncManager
Manager for orchestrating background synchronization tasks with priority-based execution. Matches enterprise's SyncManager parity.
LikeSyncTask
A task to be executed by the LikeSyncManager. Refactored to an abstract class for better parity with enterprise's SyncTask.
LikeThrottlingInterceptor
Minimal throttling interceptor for simulating various network conditions in dev.
LikeToastConfig
Configuration for the LIKE toast system.
LikeToastDelegate
Delegate for handling Toast UI in the LIKE package. Allows users to provide custom designs for connectivity, success, and error toasts.
LikeToastManager
Centralized manager for handling toasts in the LIKE package. Uses a LikeToastDelegate to allow users to override the default UI.
LikeToastType
A central class that developers can use to define application-specific toast types. Fresh developers can create extensions on this class to add their own toast shortcuts.
LikeUnpackedResponse
A standardized container for unpacked API data.
MockController
MockRule
MultipartBytesFile
Represents a file to be uploaded as byte data in a multipart request.
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.
LikeLogLevel
LikeState
Represents the possible states of a network request or data stream.
LikeSyncPriority
Priority levels for background synchronization.
LikeSyncStatus
Status of the synchronization manager.
LikeToastAnimation
Supported animation types for LIKE toasts.

Mixins

LikeAutoReconnectMixin
A mixin that provides automatic reconnection and synchronization logic for Notifiers. Features a declarative syncWith API for intelligent data refreshes. Matches the exact logic and contract of enterprise's AutoReconnectMixin.

Extensions

LikeApiResultFutureX on Future<LikeApiResult<Response>>
Extension to reduce boilerplate in repositories when dealing with Futures of results.
LikeConnectivityActions on LikeToastType
Default connectivity actions for LIKE toasts.
LikeStateResponseExtension on LikeStateResponse<T>

Constants

LikeToast → const LikeToastType
Global accessor for LIKE toast types and actions.

Functions

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 is the "Empty" action handler. It contains NO automatic toasts or haptics. Just raw state mapping.
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 disableLoadingToast = true, bool disableSuccessToast = false, bool disableErrorToast = false, bool disableExceptionToast = false, bool disableCancelledToast = true, bool enableHaptics = true, Map<LikeState, String>? messageOverrides}) Future<void>
updateNotifier is the "Full" action handler. It provides built-in toasting, haptics, and state callbacks.

Typedefs

ARS = LikeARS
Advanced Request Settings (ARS) for fine-grained network control. Mirrors the core enterprise network capabilities.
LikeModelFactory<T> = T Function(dynamic json)
Function signature for creating models from JSON.