toJson method

Map<String, dynamic> toJson()

Implementation

Map<String, dynamic> toJson() {
  final Map<String, dynamic> data = <String, dynamic>{};
  if (parts != null) {
    data['parts'] = parts!.map((v) => v.toJson()).toList();
  }
  data['role'] = role;
  return data;
}