FilteringTextInputFormatter constructor

FilteringTextInputFormatter(
  1. Pattern filterPattern,
  2. {required bool allow,
  3. String replacementString = ''}
)

Creates a formatter that replaces banned patterns with the given replacementString.

If allow is true, then the filter pattern is an allow list, and characters must match the pattern to be accepted. See also the FilteringTextInputFormatter.allow() constructor.

If allow is false, then the filter pattern is a deny list, and characters that match the pattern are rejected. See also the FilteringTextInputFormatter.deny constructor.

Implementation

FilteringTextInputFormatter(
  this.filterPattern, {
  required this.allow,
  this.replacementString = '',
});