SdkModel.fromJson constructor

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

Implementation

factory SdkModel.fromJson(Map<String, dynamic> json) => SdkModel(
  token: json["token"],
  title: json["title"] ?? "",
  aiName: json["ai_name"] ?? "Megamil AI",
  primaryColor: json["primary_color"] ?? "1A90FF",
  secondaryColor: json["secondary_color"] ?? "1A70FF",
  placeholderInput: json["placeholder_input"] ?? 'Me pergunte algo...',
  showAppBar: json["show_app_bar"] ?? true,
  listSuggestions: json["list_suggestions"] == null ? [] : List<String>.from(json["list_suggestions"]!.map((x) => x)),
  listMessages: json["list_messages"] == null ? [] : List<ListMessage>.from(json["list_messages"]!.map((x) => ListMessage.fromJson(x))),
);