TraceConfig.fromJson constructor

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

Implementation

factory TraceConfig.fromJson(Map<String, dynamic> json) {
  return TraceConfig(
    recordMode: json.containsKey('recordMode')
        ? TraceConfigRecordMode.fromJson(json['recordMode'] as String)
        : null,
    traceBufferSizeInKb: json.containsKey('traceBufferSizeInKb')
        ? json['traceBufferSizeInKb'] as num
        : null,
    enableSampling: json.containsKey('enableSampling')
        ? json['enableSampling'] as bool
        : null,
    enableSystrace: json.containsKey('enableSystrace')
        ? json['enableSystrace'] as bool
        : null,
    enableArgumentFilter: json.containsKey('enableArgumentFilter')
        ? json['enableArgumentFilter'] as bool
        : null,
    includedCategories: json.containsKey('includedCategories')
        ? (json['includedCategories'] as List)
            .map((e) => e as String)
            .toList()
        : null,
    excludedCategories: json.containsKey('excludedCategories')
        ? (json['excludedCategories'] as List)
            .map((e) => e as String)
            .toList()
        : null,
    syntheticDelays: json.containsKey('syntheticDelays')
        ? (json['syntheticDelays'] as List).map((e) => e as String).toList()
        : null,
    memoryDumpConfig: json.containsKey('memoryDumpConfig')
        ? MemoryDumpConfig.fromJson(
            json['memoryDumpConfig'] as Map<String, dynamic>)
        : null,
  );
}