Skip to content

Instantly share code, notes, and snippets.

@gunantosteven
Created May 12, 2021 14:31
Show Gist options
  • Save gunantosteven/7194af3fd498cf95bb6c5522c2897c69 to your computer and use it in GitHub Desktop.
Save gunantosteven/7194af3fd498cf95bb6c5522c2897c69 to your computer and use it in GitHub Desktop.
ErrorWidgetPage
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