Flutter:使用自定义 ErrorWidget [英] Flutter: Use custom ErrorWidget

查看:25
本文介绍了Flutter:使用自定义 ErrorWidget的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有没有办法显示(在生产中)自定义错误小部件而不是红屏死机?我不会更改框架代码,而且即使我们试图编程没有错误,我们也不能保证它会发生.

Is there a way to display (in production) a custom error widget instead of the red screen of death? I will not change the framework code, plus even though we are trying to program without errors, we can't guarantee it to happen.

推荐答案

可以通过改变ErrorWidget.builder

ErrorWidget.builder = (errorDetails) {
  return Container(color: Colors.red);
}

这篇关于Flutter:使用自定义 ErrorWidget的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆