Prompt.fromJson constructor

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

Implementation

factory Prompt.fromJson(Map<String, dynamic> json) {
  return Prompt(
    maxAttempts: json['maxAttempts'] as int,
    messages: (json['messages'] as List)
        .whereNotNull()
        .map((e) => Message.fromJson(e as Map<String, dynamic>))
        .toList(),
    responseCard: json['responseCard'] as String?,
  );
}