nosuchmethoderror:class' _bigintimpl'没有实例方法' tojson'

发布于 2025-02-14 01:30:02 字数 936 浏览 0 评论 0原文

我试图将bigint转换为Dart Dart SDK版本:2.17.3(稳定)(稳定)(6月1日1:06:06:41 2022 +0200)在“ macos_arm64”上,代码看起来像以下:

static Future<bool> updateTodoProperties(Todo todo) async {
    Map<String,Object> params =  new HashMap();
    params.putIfAbsent("id", () => todo.id);
    params.putIfAbsent("name", () => todo.name);
    var response = await RestClient.patch("/tik/todo/v1/update",params);
    if (RestClient.respSuccess(response)) {
      return true;
    }else{
      return false;
    }
  }

碰到此功能时,显示错误:

NoSuchMethodError: Class '_BigIntImpl' has no instance method 'toJson'.
Receiver: Instance of '_BigIntImpl'
Tried calling: toJson

这是todo参数看起来像:

我该怎么办来解决这个问题?

I am tried to convert the BigInt to json in dart Dart SDK version: 2.17.3 (stable) (Wed Jun 1 11:06:41 2022 +0200) on "macos_arm64", the code look like this:

static Future<bool> updateTodoProperties(Todo todo) async {
    Map<String,Object> params =  new HashMap();
    params.putIfAbsent("id", () => todo.id);
    params.putIfAbsent("name", () => todo.name);
    var response = await RestClient.patch("/tik/todo/v1/update",params);
    if (RestClient.respSuccess(response)) {
      return true;
    }else{
      return false;
    }
  }

when run into this function, show error:

NoSuchMethodError: Class '_BigIntImpl' has no instance method 'toJson'.
Receiver: Instance of '_BigIntImpl'
Tried calling: toJson

this is the todo parameter look like:

enter image description here

what should I do to fixed this problem?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文