debounced_text_form_field 1.0.3 copy "debounced_text_form_field: ^1.0.3" to clipboard
debounced_text_form_field: ^1.0.3 copied to clipboard

A drop-in replacement for TextFormField that debounces validation

example/lib/main.dart

import 'package:debounced_text_form_field/debounced_text_form_field.dart';
import 'package:example/validator.dart';
import 'package:flutter/material.dart';

void main() {
  runApp(const MyApp());
}

class MyApp extends StatelessWidget {
  const MyApp({super.key});

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      title: 'Flutter Demo',
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.deepPurple),
        useMaterial3: true,
      ),
      home: const MyHomePage(),
    );
  }
}

class MyHomePage extends StatelessWidget {
  const MyHomePage({super.key});

  @override
  Widget build(BuildContext context) {
    return Scaffold(
      appBar: AppBar(
        backgroundColor: Theme.of(context).colorScheme.inversePrimary,
        title: const Text('Debounce Text Form Field'),
      ),
      body: Center(
        child: Column(
          mainAxisAlignment: MainAxisAlignment.center,
          children: <Widget>[
            Padding(
              padding: const EdgeInsets.only(left: 16, right: 16, top: 24),
              child: DebouncedTextFormField(
                decoration: const InputDecoration(
                  hintText: 'Enter email',
                  prefixIcon: Icon(Icons.mail),
                ),
                validator: Validator.mustBeEmail(context),
              ),
            ),
          ],
        ),
      ),
    );
  }
}
23
likes
160
points
22
downloads

Publisher

verified publisherjoe-it-solutions.com

Weekly Downloads

A drop-in replacement for TextFormField that debounces validation

Repository (GitHub)
View/report issues

Documentation

API reference

License

MIT (license)

Dependencies

flutter

More

Packages that depend on debounced_text_form_field