toJson method
Converts the object to a JSON representation.
Implementation
@override
Map<String, dynamic> toJson() {
final existsPaths =
paths?.map((e) => e.map((e) => e.toJson()).toList()).toList();
final expand = existsPaths?.expand((element) => element).toList();
return {
"amount": amount.toJson(),
"destination": destination,
"destination_tag": destinationTag,
"paths": (expand?.isEmpty ?? true) ? null : existsPaths,
"invoice_id": invoiceId,
"send_max": sendMax,
"deliver_min": deliverMin,
...super.toJson()
};
}