【发布时间】:2020-05-11 23:26:47
【问题描述】:
来自https://flutter.dev/docs/cookbook/maintenance/error-reporting,
runZoned<Future<void>>(() async {
runApp(CrashyApp());
}, onError: (error, stackTrace) {
// Whenever an error occurs, call the `_reportError` function. This sends
// Dart errors to the dev console or Sentry depending on the environment.
_reportError(error, stackTrace);
});
但我的 IDE 说 onError 已弃用。
解决此问题的正确方法是什么?我在 runZonedGuarded 上没有任何示例。
【问题讨论】: