Edit Record

Loading preview

Starting the Flutter app

A Flutter admin edit form with grouped fields, switches, and save and cancel actions.

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

The name and email TextFormFields use TextEditingControllers seeded with sample values, while the role dropdown and two SwitchListTiles keep state in _role, _active and _twoFactor. Both save buttons call _save, which reads the current values into a SnackBar. Nothing is validated or stored. Cancel shows a demo SnackBar, and the avatar’s edit badge is decoration with no tap target.

Adapting it

  • Wrap the ListView in a Form with a GlobalKey<FormState>, then validate the email in _save.
  • Replace the SnackBar in _save with your update request.
  • Pass the user through the EditForm constructor to replace ‘Alex Kim’ and the default _role.