DartBridgeDevice class
Device bridge for C++ device manager operations.
Matches Swift's CppBridge+Device.swift.
Provides callbacks for:
- Device info gathering (via device_info_plus)
- Device ID retrieval (via shared_preferences + unique ID)
- Registration persistence (via shared_preferences)
- HTTP transport (via http package)
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
clearRegistration(
) → Future< void> - Clear device registration (for testing)
-
getDeviceId(
) → Future< String> - Get the cached or generated device ID
-
isDeviceRegistered(
) → bool - Check if device is registered with backend
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerIfNeeded(
) → Future< void> - Register device with backend if not already registered
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Properties
- cachedDeviceId → String?
-
Get the cached device ID synchronously (null if not yet cached)
no setter
- instance → DartBridgeDevice
-
final
Static Methods
-
register(
{required SDKEnvironment environment, String? baseURL, String? accessToken}) → Future< void> - Register device callbacks with C++ (full async init, Phase 2) Must be called during SDK init after platform adapter
-
registerCallbacks(
) → void - Register device callbacks synchronously (Phase 1). Matches Swift: Device.register() in CppBridge.initialize() This registers the C++ callbacks without initializing SharedPreferences or caching device ID (those happen in Phase 2).
-
setAccessToken(
String? token) → void - Update access token (called after authentication)