[英]Error: Converting object to an encodable object failed
错误:
Произошло исключение.
JsonUnsupportedObjectError (Converting object to an encodable object failed: Closure: () => Map<dynamic, dynamic>)
代码:
Map toJson() => {
"UnigTime": {
"hour": _timerHourCurrentSliderValue,
"minute": _timerMinuteCurrentSliderValue.toInt()
}
};
final jsonAllTime = jsonEncode(toJson);
Server().async(jsonAllTime);
您正在尝试转换Function
。 而不是这条线
final jsonAllTime = jsonEncode(toJson);
你应该有这一行,它返回Map
final jsonAllTime = jsonEncode(toJson());
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.