BackgroundDeliveryConfig.fromJson constructor

BackgroundDeliveryConfig.fromJson(
  1. Map<String, dynamic> json
)

Implementation

factory BackgroundDeliveryConfig.fromJson(Map<String, dynamic> json) {
  return BackgroundDeliveryConfig(
    statisticsTypes: (json['statistics_types'] as List?)?.map((e) => StatisticsType.fromString(e as String)).whereType<StatisticsType>().toSet(),
    metricTypes: (json['metric_types'] as List?)?.map((e) => MetricType.fromString(e as String)).whereType<MetricType>().toSet(),
    activityConfigs: (json['activity_configs'] as List?)?.map((e) => ActivityConfig.fromJson(e as Map<String, dynamic>)).whereType<ActivityConfig>().toSet(),
    sleepConfigs: (json['sleep_configs'] as List?)?.map((e) => SleepConfig.fromJson(e as Map<String, dynamic>)).whereType<SleepConfig>().toSet(),
    healthConnectEnabled: json['health_connect_enabled'] as bool?,
    samsungHealthDataEnabled: json['samsung_health_data_enabled'] as bool?,
  );
}