mb_contact_form 1.1.3
mb_contact_form: ^1.1.3 copied to clipboard
A plug-and-play Flutter contact form widget with name, email, and message fields, built-in validation, and native mail app integration.
mb_contact_form #
A plug-and-play contact form widget for Flutter — name, email, and message with built-in validation.
Drop-in contact form with name, email, and message fields. Validates input and opens the device mail app with a pre-filled message on submit — no backend required.
Features #
✦ Name, email, and message fields with built-in validation
✦ Opens native mail app on submit — no backend or API keys needed
✦ Optional icons on each field
✦ Optional "Contact Form" heading
✦ Works on Android, iOS, web, and desktop
Installation #
Add to your pubspec.yaml:
dependencies:
mb_contact_form: ^1.0.2
Then run:
flutter pub get
Usage #
import 'package:mb_contact_form/mb_contact_form.dart';
MBContactForm(
destinationEmail: 'you@example.com',
withIcons: true,
hasHeading: true,
)
Place it anywhere in your widget tree — inside a Scaffold, a Column, a modal sheet, wherever fits.
Parameters #
| Parameter | Type | Default | Description |
|---|---|---|---|
destinationEmail |
String |
required | Email address that receives the submitted message |
withIcons |
bool |
required | Show icons next to each field |
hasHeading |
bool |
true |
Show "Contact Form" heading at the top of the card |
How It Works #
When the user taps Submit:
- All fields are validated — name (first + last), email format, non-empty message.
- A
mailto:URI is built with subjectFeedback from <name>and the body set to the message. - The device's default mail app opens with everything pre-filled.
user fills form → taps Submit → validation passes
└── mailto: URI constructed
└── native mail app opens, pre-filled ✅
Contributing #
Contributions are welcome! Please follow the conventional commits format when committing.
Made with 🎯 by @moulibheemaneti
MIT License