flutter_form_filler 0.1.1 copy "flutter_form_filler: ^0.1.1" to clipboard
flutter_form_filler: ^0.1.1 copied to clipboard

A debug-only widget to auto-fill Flutter forms with mock data. Wrap any screen with FormFillerWrapper to populate fields 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:

flutter_form_filler demo

Features #

  • One-line integration — wrap a screen with FormFillerWrapper(child: YourScreen()).
  • Smart field detection — inspects keyboardType, obscureText, labelText, and hintText to 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 like john42@yourcompany.com.
  • Multiline support — fields with maxLines > 1 get 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 readOnly and disabled fields; deduplicates controllers; catches errors from third-party widgets.

Supported Field Types #

Detected As Signals Example Output
Email 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_dependencies since 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 #

  1. FormFillerWrapper overlays a FAB on top of your screen using a Stack.
  2. When tapped, it traverses the child's widget tree via Element.visitChildElements.
  3. For each TextField found (including those inside TextFormField), it:
    • Skips readOnly and disabled fields.
    • Extracts the TextEditingController (explicit or internal via EditableText).
    • Classifies the field using keyboard type, obscure flag, and label/hint keywords.
  4. A MockDataGenerator (backed by faker) produces a value for each field type.
  5. 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.

1
likes
160
points
164
downloads

Documentation

API reference

Publisher

verified publisherkevinhector.com

Weekly Downloads

A debug-only widget to auto-fill Flutter forms with mock data. Wrap any screen with FormFillerWrapper to populate fields instantly.

Repository (GitHub)
View/report issues

License

MIT (license)

Dependencies

faker, flutter

More

Packages that depend on flutter_form_filler