DeviceContext class
Represents device and operating system information for context-aware evaluation
Constructors
-
DeviceContext.new({String? manufacturer, String? model, String? osName, String? osVersion, String sdkVersion = '1.0.0', String? appId, String? appVersion, String? locale, String? timezone, int? screenWidth, int? screenHeight, double? screenDensity, String? networkType, String? networkCarrier, Map<
String, dynamic> customAttributes = const {}}) - Constructor
-
DeviceContext.fromJson(Map<
String, dynamic> json) -
Factory constructor for JSON deserialization
factory
-
DeviceContext.fromMap(Map<
String, dynamic> map) -
Creates a DeviceContext from a map representation
factory
Properties
- appId → String?
-
Application identifier
final
- appVersion → String?
-
Application version
final
-
customAttributes
→ Map<
String, dynamic> -
Additional custom attributes
final
- hashCode → int
-
The hash code for this object.
no setterinherited
- locale → String?
-
Device locale
final
- manufacturer → String?
-
Device manufacturer
final
- model → String?
-
Device model
final
- networkCarrier → String?
-
Network carrier
final
- networkType → String?
-
Network type (e.g., "wifi", "cellular")
final
- osName → String?
-
Operating system name (e.g., "Android", "iOS")
final
- osVersion → String?
-
Operating system version
final
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- screenDensity → double?
-
Device screen density (DPI)
final
- screenHeight → int?
-
Device screen height in pixels
final
- screenWidth → int?
-
Device screen width in pixels
final
- sdkVersion → String
-
SDK version
final
- timezone → String?
-
Device timezone
final
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Alias for toMap for JSON serialization
-
toMap(
) → Map< String, dynamic> - Converts the device context to a map for sending to the API
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
createBasic(
) → DeviceContext - Creates a basic device context with system properties