首页 > 解决方案 > Flutter Object3D在解析.obj(对象文件)时抛出无效的double

问题描述

我正在探索Object3D包,它对某些 .Obj 文件运行良好,但在某些没有错误的文件上失败,在某些文件上,它会抛出此错误消息

        The following FormatException was thrown during paint():
    Invalid double
    
    The relevant error-causing widget was:
    CustomPaint file:///C:/Users/Tiwari/.AndroidStudio4.0/flutter/.pub-cache/hosted/pub.dartlang.org/flutter_3d_obj-0.0.6/lib/flutter_3d_obj.dart:120:18
    When the exception was thrown, this was the stack:
    #0      double.parse (dart:core-patch/double_patch.dart:111:28)
    #1      _ObjectPainter._parseObjString.<anonymous closure> (package:flutter_3d_obj/flutter_3d_obj.dart:190:37)
    #2      List.forEach (dart:core-patch/growable_array.dart:313:8)
    #3      _ObjectPainter._parseObjString (package:flutter_3d_obj/flutter_3d_obj.dart:177:11)
    #4      _ObjectPainter.paint (package:flutter_3d_obj/flutter_3d_obj.dart:316:22)
    ...
    The following RenderObject was being processed when the exception was fired: RenderCustomPaint#b558d relayoutBoundary=up4
    ...  parentData: <none> (can use size)
    ...  constraints: BoxConstraints(0.0<=w<=423.5, 0.0<=h<=799.2)
    ...  size: Size(40.0, 40.0)
    RenderObject: RenderCustomPaint#b558d relayoutBoundary=up4
    parentData: <none> (can use size)
    constraints: BoxConstraints(0.0<=w<=423.5, 0.0<=h<=799.2)
    size: Size(40.0, 40.0)

从这里下载的文件

我应该如何调试这个,这个错误来自包但没有给出它失败的值,我尝试使用调试器并尝试通过编辑包文件来打印值但没有工作。

标签: flutterflutter-dependenciesflutter-test

解决方案


推荐阅读