like library

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

Classes

CancelToken
Controls cancellation of Dio's requests.
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.
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.
LikeEngine
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.
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.
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
LikeNotifierState<T>
A class that encapsulates a LikeStateResponse and its associated CancelToken.
LikeRequestConfig
Per-request network configuration overrides for the LIKE engine.
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>
LikeSliverBuilder<T>
LikeStateResponse<T>
The State Engine of the LIKE package. Manages the lifecycle of a request, including SWR and background refreshes.
LikeStateResponseBuilder<T>
LikeStateResponseBuilder<T>
LikeStateResponseBuilderSliver<T extends Object>
LikeStateResponseBuilderSliver<T>
LikeToastConfig
Configuration for user toast/notification callbacks in the LIKE network engine.
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.
PaginatedNotifierState<T>
A specialized NotifierState that manages paginated data, cleanly separating the 1st page / initial state from the load-more (pagination) state.
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.
LikeLogLevel
LikeState
Represents the possible states of a network request or data stream.
LikeSyncPriority
Priority levels for background synchronization.

Mixins

LikeStateMixin
A mixin that provides automatic reconnection, data pipeline binding, and state management for Notifiers.
LikeVisibilityMixin<T extends StatefulWidget>
A mixin for State classes that provides visibility tracking based on route navigation.

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 num and num?.
LikeStateResponseExtension on LikeStateResponse<T>
LikeStringExtension on String?
Null-safe String extension utilities available on both String and String?.

Properties

likeRouteObserver RouteObserver<ModalRoute<void>>
Global route observer for LikeVisibilityMixin. 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 disableLoadingToast = true, bool disableSuccessToast = false, bool disableErrorToast = false, bool disableExceptionToast = false, bool disableCancelledToast = true, bool enableHaptics = true, Map<LikeState, String>? messageOverrides}) 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.
NotifierState<T> = LikeNotifierState<T>
A convenience alias for LikeNotifierState.
Pagination<T> = PaginationTool<T>
Backward compatibility alias for PaginationTool.
StateEngine = LikeEngine
A convenience alias for LikeEngine.
StateMixin = LikeStateMixin
Shorter alias for LikeStateMixin.
StateResponse<T> = LikeStateResponse<T>
A shorter, cleaner alias for LikeStateResponse.
States = LikeState
A shorter, cleaner alias for LikeState.