当Flutter框架抛出错误时,我曾经看到完整的堆栈跟踪。但是,自最近发布以来,除了以下消息之外,没有显示堆栈跟踪。
完整代码
import 'package:flutter/material.dart';
class BtnApp extends StatelessWidget {
final String title;
BtnApp([this.title]);
@override
Widget build(BuildContext context) {
if (title.substring(0, 1) == '/') {
print('start with /');
} else {
print('other');
}
return new Container();
}
}
main() {
runApp(new BtnApp());
}
输出
Launching lib/tinker/btnapp.dart on iPhone 7 in debug mode...
Running pod install...
Running Xcode build...
Syncing files to device iPhone 7...
══╡ EXCEPTION CAUGHT BY WIDGETS LIBRARY ╞════════
The method 'substring' was called on null.
Receiver: null
When the exception was thrown, this was the stack:
════════════════════════════════════════════════════════
此处没有堆栈跟踪