DeviceContext class
Device context. Serializes with toJson using keys expected by the schema validator (os, osVersion). fromJson accepts both validator keys and native keys (operating_system, os_version) so events from native round-trip correctly.
- Annotations
-
- @JsonSerializable.new()
Constructors
- DeviceContext({String? device, String? deviceName, bool? emulator, String? os, dynamic osVersion, String? networkConnectionType, String? networkConnectionSubtype, String? userAgent})
-
DeviceContext.fromJson(Map<
String, dynamic> json) -
Accepts both validator keys (os, osVersion) and native keys (operating_system, os_version).
factory
Properties
- device ↔ String?
-
getter/setter pair
- deviceName ↔ String?
-
getter/setter pair
- emulator ↔ bool?
-
getter/setter pair
- hashCode → int
-
The hash code for this object.
no setterinherited
- networkConnectionSubtype ↔ String?
-
getter/setter pair
- networkConnectionType ↔ String?
-
getter/setter pair
- os ↔ String?
-
getter/setter pair
- osVersion ↔ dynamic
-
getter/setter pair
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
- userAgent ↔ String?
-
getter/setter pair
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toJson(
) → Map< String, dynamic> - Emits keys expected by the schema validator (os, osVersion) so validation passes. Omits operating_system, os_version, network_connection_subtype (validator forbids), and omits networkConnectionType and userAgent from outgoing payload by design. Only includes os/osVersion when non-null to avoid empty strings that may fail validation.
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited