Error 500

Loading preview

Starting the Flutter app

Warning icon, expandable error details, retry button

Get the source

Add it to your project

Copies the Dart source into your app, so you own it. Flutter SDK only, no extra packages.

First time? Run dart pub global activate fluttertemplates_dev, or read the CLI guide.

How it works

A StatelessWidget, since ExpansionTile manages its own open state. The content sits in a SingleChildScrollView, so opening the details on a short screen scrolls instead of overflowing. The error text, including the January 2024 timestamp, is a hardcoded string, and Retry only shows a demo SnackBar.

Adapting it

  • Pass the exception message into Error500, and show it only in debug builds.
  • Accept an onRetry callback for the FilledButton.icon.
  • Show a support reference in place of raw details in production.