flutter_form_filler 0.1.0
flutter_form_filler: ^0.1.0 copied to clipboard
A debug-only Flutter widget that auto-fills form fields with realistic mock data. Wrap any screen with FormFillerWrapper and tap the FAB to populate TextFields and TextFormFields instantly.
flutter_form_filler #
A debug-only Flutter widget that auto-fills form fields with realistic mock data.
Wrap any screen with FormFillerWrapper, tap the floating wand button, and watch
every TextField and TextFormField populate instantly.
Demo #
See FormFillerWrapper auto-detect and populate a realistic form:

Features #
- One-line integration — wrap a screen with
FormFillerWrapper(child: YourScreen()). - Smart field detection — inspects
keyboardType,obscureText,labelText, andhintTextto pick the right kind of data. - Realistic data — powered by the faker package (names, emails, phones, addresses, and more).
- Custom email domains — pass
customEmailDomain: 'yourcompany.com'to generate emails likejohn42@yourcompany.com. - Multiline support — fields with
maxLines > 1get a lorem paragraph instead of a single word. - Debug-only — the FAB is gated behind
kDebugMode, so it never appears in release builds. - Safe traversal — skips
readOnlyanddisabledfields; deduplicates controllers; catches errors from third-party widgets.
Supported Field Types #
| Detected As | Signals | Example Output |
|---|---|---|
TextInputType.emailAddress, label/hint contains "email" |
jane42@testmail.dev |
|
| Phone | TextInputType.phone, "phone" / "mobile" |
(555) 123-4567 |
| First Name | "first name" | Alice |
| Last Name | "last name" / "surname" | Johnson |
| Full Name | "name" | Alice Johnson |
| Username | "user" / "username" | cool_alice |
| Password | obscureText: true, "password" / "pin" |
xK9#mP2q |
| URL | TextInputType.url, "website" / "link" |
https://example.com |
| Number | TextInputType.number |
4821 |
| Address | "address" / "street" | 742 Evergreen Terrace |
| City | "city" / "town" | Springfield |
| Zip Code | "zip" / "postal" | 62704 |
| Unknown | No match (single-line) | lorem |
| Unknown | No match (multiline) | A 3-sentence paragraph |
Getting Started #
Add the package to your pubspec.yaml:
dev_dependencies:
flutter_form_filler: ^0.1.0
Then run:
flutter pub get
Tip: Add it under
dev_dependenciessince it's a development tool — it has zero effect on release builds.
Usage #
Wrap any screen (or subtree) you want to test:
import 'package:flutter_form_filler/flutter_form_filler.dart';
class MyApp extends StatelessWidget {
@override
Widget build(BuildContext context) {
return MaterialApp(
home: FormFillerWrapper(
customEmailDomain: 'testmail.dev', // optional
child: RegistrationScreen(),
),
);
}
}
A floating wand button appears in the bottom-right corner. Tap it to fill every detected text field with appropriate mock data.
How It Works #
FormFillerWrapperoverlays a FAB on top of your screen using aStack.- When tapped, it traverses the child's widget tree via
Element.visitChildElements. - For each
TextFieldfound (including those insideTextFormField), it:- Skips
readOnlyanddisabledfields. - Extracts the
TextEditingController(explicit or internal viaEditableText). - Classifies the field using keyboard type, obscure flag, and label/hint keywords.
- Skips
- A
MockDataGenerator(backed byfaker) produces a value for each field type. - Controllers are updated and a snackbar confirms how many fields were filled.
Example #
A full example app is included in the example/ directory:
cd example
flutter run
If the example has not been bootstrapped on your machine yet, generate the platform runners first:
cd example
flutter create . --project-name flutter_form_filler_example
flutter run -d macos
Publishing #
Before publishing, validate the package:
flutter analyze
flutter test
dart pub publish --dry-run
If the dry run passes cleanly, publish with:
dart pub publish
License #
MIT — see LICENSE for details.