toJson method

Map<String, dynamic> toJson()

Produces a Map that can be serialized to JSON.

Implementation

Map<String, dynamic> toJson() {
  return {
    if (name != null) 'app_name': name!,
    if (version != null) 'app_version': version!,
    if (identifier != null) 'app_identifier': identifier!,
    if (build != null) 'app_build': build!,
    if (buildType != null) 'build_type': buildType!,
    if (startTime != null) 'app_start_time': startTime!.toIso8601String(),
    if (deviceAppHash != null) 'device_app_hash': deviceAppHash!,
    if (appMemory != null) 'app_memory': appMemory!,
    if (inForeground != null) 'in_foreground': inForeground!,
    if (viewNames != null && viewNames!.isNotEmpty) 'view_names': viewNames!,
    if (textScale != null) 'text_scale': textScale!,
  };
}