Error 404

Loading preview

Starting the Flutter app

Large 404, playful design, Go Home 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

Layout only: a large 404 in displayLarge, using the theme’s primary color, over two lines of explanation and a Go Home button. With no AppBar there’s no back arrow, and the button only shows a demo SnackBar, leaving users on this screen. Nothing connects it to your router yet.

Adapting it

  • Register Error404 as your go_router errorBuilder, or as onUnknownRoute on MaterialApp.
  • Replace _showDemo in onPressed to return to your home route, clearing the stack.
  • Accept the failed path as an Error404 parameter if you want to log it.