2019.9.30 ErrorWidget use

Development process will always run into a page fault occurs, this time the entire page is red,

as follows

 

Testing phase even if such a problem, if a formal environment will also appear this discord. So there ErrorWidget. This is to set it at the bottom of this page you can shield a.

code show as below:

void setCustomErrorPage() {
  ErrorWidget.builder = (FlutterErrorDetails flutterErrorDetails) {
    print(flutterErrorDetails.toString());
    return Container(
      color: Colors.white,
      child: Center(
        child: Image.asset('images/timg-2.jpeg'),
      ),
    );
  };
}

 

The introduction of the following

void main() {
  setCustomErrorPage();
}

 

When an error occurs will show the following page

 

 

over ------------------------

 

Guess you like

Origin www.cnblogs.com/110-913-1025/p/11613241.html
use
use