ClientAnalyticsEvent.fromJson constructor
ClientAnalyticsEvent.fromJson(
- Map<String, dynamic> json
)
Implementation
ClientAnalyticsEvent.fromJson(Map<String, dynamic> json) {
type = ClientEventType.values.firstWhere(
(element) => element.value == json['type'],
orElse: () => ClientEventType.clientError,
);
timestamp = json['timestamp'];
flagKey = json['flagKey'];
flagId = json['flagId'];
value = json['value'];
userId = json['userId'];
duration = json['duration'];
source = ClientEventSource.values.firstWhere(
(element) => element.value == json['source'],
orElse: () => ClientEventSource.sdkClient,
);
error = json['error'];
errorCode = json['errorCode'];
sdkVersion = json['sdkVersion'];
platformType = json['platformType'];
environment = json['environment'];
context = json['context'];
}