Like class
The top-level wrapper for applications using the LIKE networking package. Handles initialization of connectivity monitoring, persistent storage, background synchronization, and authentication interceptors.
- Inheritance
Constructors
-
Like({Key? key, required Widget child, ValueNotifier<
bool> ? isSyncing, Widget? syncOverlay, Widget? loadingWidget, bool showConnectivityToasts = true, String? baseUrl, Future<String?> getToken()?, Future<String?> refreshToken()?, Future<void> onLogout({bool force, int? statusCode})?, Future<String?> getApiKey()?, Widget syncProgressBuilder(String title, String message, double progress)?, LikeToastConfig? toastConfig, LikeToastDelegate? toastDelegate, Widget devTool(Widget child)?}) -
const
Properties
- baseUrl → String?
-
The base URL for all network requests. This is the root-level configuration.
final
- child → Widget
-
The main application widget tree.
final
- devTool → Widget Function(Widget child)?
-
Optional debug-only wrapper injected by an external devtool package.
final
-
getApiKey
→ Future<
String?> Function()? -
A function used by LikeAuthInterceptor to retrieve the API Key.
final
-
getToken
→ Future<
String?> Function()? -
A function used by LikeAuthInterceptor to retrieve the current user's session token.
final
- hashCode → int
-
The hash code for this object.
no setterinherited
-
isSyncing
→ ValueNotifier<
bool> ? -
A ValueNotifier used to show/hide the global synchronization overlay.
If not provided, the widget will automatically use LikeService.isSyncing.
final
- key → Key?
-
Controls how one widget replaces another widget in the tree.
finalinherited
- loadingWidget → Widget?
-
Custom widget to display while the LIKE engine is performing its initial setup.
final
-
onLogout
→ Future<
void> Function({bool force, int? statusCode})? -
A function used by LikeAuthInterceptor to handle logout on authentication error.
final
-
refreshToken
→ Future<
String?> Function()? -
A function used by LikeAuthInterceptor to perform token refresh.
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- showConnectivityToasts → bool
-
Whether to automatically display
Toastificationalerts when internet connectivity changes.final - syncOverlay → Widget?
-
Custom widget to display when isSyncing is true.
final
- syncProgressBuilder → Widget Function(String title, String message, double progress)?
-
Custom builder for the synchronization progress toast.
final
- toastConfig → LikeToastConfig?
-
Configuration for network-related toasts.
final
- toastDelegate → LikeToastDelegate?
-
A custom delegate to control how network-related toasts are displayed and styled.
If provided, this takes precedence over individual widget overrides.
final
Methods
-
createElement(
) → StatefulElement -
Creates a StatefulElement to manage this widget's location in the tree.
inherited
-
createState(
) → State< Like> -
Creates the mutable state for this widget at a given location in the tree.
override
-
debugDescribeChildren(
) → List< DiagnosticsNode> -
Returns a list of DiagnosticsNode objects describing this node's
children.
inherited
-
debugFillProperties(
DiagnosticPropertiesBuilder properties) → void -
Add additional properties associated with the node.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toDiagnosticsNode(
{String? name, DiagnosticsTreeStyle? style}) → DiagnosticsNode -
Returns a debug representation of the object that is used by debugging
tools and by DiagnosticsNode.toStringDeep.
inherited
-
toString(
{DiagnosticLevel minLevel = DiagnosticLevel.info}) → String -
A string representation of this object.
inherited
-
toStringDeep(
{String prefixLineOne = '', String? prefixOtherLines, DiagnosticLevel minLevel = DiagnosticLevel.debug, int wrapWidth = 65}) → String -
Returns a string representation of this node and its descendants.
inherited
-
toStringShallow(
{String joiner = ', ', DiagnosticLevel minLevel = DiagnosticLevel.debug}) → String -
Returns a one-line detailed description of the object.
inherited
-
toStringShort(
) → String -
A short, textual description of this widget.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited