Created
May 12, 2021 14:31
-
-
Save gunantosteven/7194af3fd498cf95bb6c5522c2897c69 to your computer and use it in GitHub Desktop.
ErrorWidgetPage
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
void main() { | |
ErrorWidget.builder = (FlutterErrorDetails details) { | |
return ErrorWidgetPage(details); | |
}; | |
runApp(MyApp()); | |
} | |
class ErrorWidgetPage extends StatelessWidget { | |
ErrorWidgetPage(this.details); | |
FlutterErrorDetails details; | |
@override | |
Widget build(BuildContext context) { | |
return Column( | |
children: [ | |
RaisedButton( | |
padding: const EdgeInsets.all(8.0), | |
textColor: Colors.white, | |
color: Colors.blue, | |
onPressed: () { | |
// Route to the first screen | |
Navigator.replace<void>( | |
context, | |
MaterialPageRoute(builder: (context) => FirstRoute()), | |
); | |
}, | |
child: const Text("Reset app"), | |
), | |
Container( | |
color: Colors.blue, | |
child: Text( | |
details.toString(), | |
style: const TextStyle( | |
color: Colors.white, | |
), | |
), | |
), | |
], | |
); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment