Forgot Password

Loading preview

Starting the Flutter app

Email input, success state, back to login

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 single boolean, _sent, switches the body between _buildForm and _buildSuccessState. _submit runs the TextFormField validator, which rejects empty and malformed addresses, before setting _sent. No request is made, so the success screen is only a demonstration. Both Back to Login buttons call onBackToLogin, or show a demo SnackBar without it.

Adapting it

  • Await your reset call in _submit before setting _sent.
  • Track a loading flag next to _sent to disable the button while the request runs.
  • Soften the copy in _buildSuccessState to “if an account exists” so the page can’t be used to discover registered emails.