Add missing docs (#9696)

This commit is contained in:
Adam Barth 2017-05-01 12:18:30 -07:00 committed by GitHub
parent 2ab631b702
commit 48f2770e4e

View File

@ -8,7 +8,7 @@ import 'package:flutter/services.dart';
/// to provide as-you-type validation and formatting of the text being edited. /// to provide as-you-type validation and formatting of the text being edited.
/// ///
/// Text modification should only be applied when text is being committed by the /// Text modification should only be applied when text is being committed by the
/// IME and not on text under composition (i.e. when /// IME and not on text under composition (i.e., only when
/// [TextEditingValue.composing] is collapsed). /// [TextEditingValue.composing] is collapsed).
/// ///
/// Concrete implementations [BlacklistingTextInputFormatter], which removes /// Concrete implementations [BlacklistingTextInputFormatter], which removes
@ -75,7 +75,8 @@ class _SimpleTextInputFormatter extends TextInputFormatter {
/// characters patterns. /// characters patterns.
/// ///
/// Instances of blacklisted characters found in the new [TextEditingValue]s /// Instances of blacklisted characters found in the new [TextEditingValue]s
/// will be replaced with the [replacementString] which defaults to ``. /// will be replaced with the [replacementString] which defaults to the empty
/// string.
/// ///
/// Since this formatter only removes characters from the text, it attempts to /// Since this formatter only removes characters from the text, it attempts to
/// preserve the existing [TextEditingValue.selection] to values it would now /// preserve the existing [TextEditingValue.selection] to values it would now
@ -83,15 +84,16 @@ class _SimpleTextInputFormatter extends TextInputFormatter {
/// ///
/// See also: /// See also:
/// ///
/// * [TextInputFormatter]. /// * [WhitelistingTextInputFormatter], which uses a whitelist instead of a
/// * [WhitelistingTextInputFormatter]. /// blacklist.
class BlacklistingTextInputFormatter extends TextInputFormatter { class BlacklistingTextInputFormatter extends TextInputFormatter {
/// Creates a formatter that prevents the insertion of blacklisted characters patterns.
///
/// The [blacklistedPattern] must not be null.
BlacklistingTextInputFormatter( BlacklistingTextInputFormatter(
this.blacklistedPattern, this.blacklistedPattern, {
{
this.replacementString: '', this.replacementString: '',
} }) : assert(blacklistedPattern != null);
) : assert(blacklistedPattern != null);
/// A [Pattern] to match and replace incoming [TextEditingValue]s. /// A [Pattern] to match and replace incoming [TextEditingValue]s.
final Pattern blacklistedPattern; final Pattern blacklistedPattern;
@ -126,9 +128,12 @@ class BlacklistingTextInputFormatter extends TextInputFormatter {
/// ///
/// See also: /// See also:
/// ///
/// * [TextInputFormatter]. /// * [BlacklistingTextInputFormatter], which uses a blacklist instead of a
/// * [BlacklistingTextInputFormatter]. /// whitelist.
class WhitelistingTextInputFormatter extends TextInputFormatter { class WhitelistingTextInputFormatter extends TextInputFormatter {
/// Creates a formatter that allows only the insertion of whitelisted characters patterns.
///
/// The [blacklistedPattern] must not be null.
WhitelistingTextInputFormatter(this.whitelistedPattern) : WhitelistingTextInputFormatter(this.whitelistedPattern) :
assert(whitelistedPattern != null); assert(whitelistedPattern != null);