toJson method

  1. @override
Map<String, dynamic> toJson()
override

Implementation

@override
Map<String, dynamic> toJson() => {
      'type': type,
      if (id != null) 'id': id,
      'role': role,
      'content': content.map((c) => c.toJson()).toList(),
      if (status != null) 'status': status,
    };