LiveActivityContent.fromJson constructor

LiveActivityContent.fromJson(
  1. dynamic json
)

Implementation

factory LiveActivityContent.fromJson(dynamic json) {
  final Map<String, Object?> data =
      LiveActivity._ensureStringDynamicMap(json);

  return LiveActivityContent(
    state: LiveActivity._ensureStringDynamicMap(data['state'] ?? {}),
    staleDate: data['staleDate'] as String?,
    relevanceScore: (data['relevanceScore'] as num?)?.toDouble() ?? 0.0,
  );
}