Contact Form

Loading preview

Starting the Flutter app

Name, email, subject, message, and attachment placeholder

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

Four TextFormFields sit in a Form: all are required, and the email must look like an address. The Message field pairs maxLines: 5 with alignLabelWithHint to keep its label at the top. The attachment row is only an Icon and wrapping text marked as a placeholder, and Send validates, then passes a ContactMessage to onSubmit, or shows a demo SnackBar without it.

Adapting it

  • POST to your endpoint from onSubmit, with loading and error states.
  • Replace the attachment Row with a real picker, for example the file_picker package.