date_input_formatter 0.0.1 copy "date_input_formatter: ^0.0.1" to clipboard
date_input_formatter: ^0.0.1 copied to clipboard

A Flutter package provides TextInputFormatter that format input with pre-defined pattern for date inputs.

DateInputFormatter #

A Dart package that provides a custom TextInputFormatter for formatting and validating date input in Flutter.

Note: This package is the improved version of pattern_formatter package by adding validations to DateInputFormatter.

Installation #

Add dateinputformatter as a dependency in your pubspec.yaml file:

dependencies:
  dateinputformatter: ^1.0.0

How to use #

import 'package:date_input_formatter/date_input_formatter.dart';

Usage #

I strongly suggest these below parts while using this package to prevent undesired problems:

  • set enableInteractiveSelection to false,
  • also use FilteringTextInputFormatter.allow(RegExp(r'[0-9/-]'))
    TextField(
        enableInteractiveSelection: false,
        inputFormatters: [
            FilteringTextInputFormatter.allow(RegExp(r'[0-9/-]')),
            DateInputFormatter(),
        ],
        decoration: const InputDecoration(border: OutlineInputBorder()),
    ),
3
likes
160
points
24
downloads

Publisher

unverified uploader

Weekly Downloads

A Flutter package provides TextInputFormatter that format input with pre-defined pattern for date inputs.

Repository (GitHub)
View/report issues

Documentation

API reference

License

BSD-3-Clause (license)

Dependencies

flutter

More

Packages that depend on date_input_formatter