WidgetContent.fromJson constructor

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

Implementation

factory WidgetContent.fromJson(Map<String, dynamic> json) {
  return WidgetContent(
    title: json['title'] as String? ?? '',
    description: json['description'] as String? ?? '',
    imageUrl: json['image_url'] as String? ?? '',
    actions: (json['actions'] as List<dynamic>?)
            ?.map((e) => WidgetAction.fromJson(e as Map<String, dynamic>))
            .toList() ??
        [],
  );
}