[英]Converting object to an encodable object failed: Instance of model
嘗試執行 API 調用時出現以下錯誤
[VERBOSE-2:ui_dart_state.cc(186)] Unhandled Exception: Converting object to an encodable object failed: Instance of 'PaymentStatus'
上述部分的初始化代碼如下所示
double amount,
double discount,
String coupon,
double total,
String transactionCode,
PaymentStatus paymentStatus,
PaymentMode paymentMode,
PaymentType paymentType,
int node,
int user
這似乎是枚舉。 但是 JSON 編碼仍然存在一些問題。
您可能應該嘗試將枚舉轉換為字符串並希望問題能夠得到解決。
paymentStatus = PaymentStatus.something.toString();
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.