例如:
如果我在DartPad中运行此App,则控制台只会显示Script Error
。如何获得更多信息(确切的错误是什么?它在哪里?,...)?
最佳答案
尝试在Android Studio或VS Code之类的IDE中运行。似乎由于第40行中的表格而出现错误。
════════ Exception caught by rendering library ═════════════════════════════════════════════════════
The following assertion was thrown during paint():
'package:flutter/src/rendering/table_border.dart': Failed assertion: line 217 pos 12: 'columns.isEmpty || (columns.first >= 0.0 && columns.last <= rect.width)': is not true.
Either the assertion indicates an error in the framework itself, or we should provide substantially more information in this error message to help you determine and fix the underlying cause.
In either case, please report this assertion by filing a bug on GitHub:
https://github.com/flutter/flutter/issues/new?template=BUG.md
The relevant error-causing widget was:
Table file:///home/shaquib/AndroidStudioProjects/overflow_app/lib/main.dart:40:16
When the exception was thrown, this was the stack:
#2 TableBorder.paint (package:flutter/src/rendering/table_border.dart:217:12)
#3 RenderTable.paint (package:flutter/src/rendering/table.dart:1175:14)
#4 RenderObject._paintWithContext (package:flutter/src/rendering/object.dart:2266:7)
#5 PaintingContext.paintChild (package:flutter/src/rendering/object.dart:186:13)
#6 RenderShiftedBox.paint (package:flutter/src/rendering/shifted_box.dart:72:15)
或者,您可以在Github(https://github.com/dart-lang/dart-pad/issues/705)中重新打开此错误,以弄清楚为什么该错误在DartPad中不起作用。关于flutter - DartPad:如果控制台仅打印 'Script Error',如何获取更多信息?,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/64510682/