Skip to content
This repository was archived by the owner on May 20, 2023. It is now read-only.

Commit 677c937

Browse files
committed
Cleanup maxCount and showCharacterCount documentation.
Addresses questions about these comments when they synced to the open source release. #225 PiperOrigin-RevId: 187925815
1 parent 9125d5a commit 677c937

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

lib/material_input/base_material_input.dart

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ class BaseMaterialInput extends FocusableMixin
113113

114114
/// Maximum allowed characters for character counting input box.
115115
///
116-
/// Always shows character count if the field is non-null.
116+
/// Character count always is displayed when the value is non-null.
117117
@Input()
118118
int maxCount;
119119

@@ -177,7 +177,7 @@ class BaseMaterialInput extends FocusableMixin
177177
}
178178
}
179179

180-
/// Displays character count even if maxCount is not defined.
180+
/// Display character count even if maxCount is null.
181181
@Input()
182182
bool showCharacterCount = false;
183183

@@ -434,7 +434,8 @@ class BaseMaterialInput extends FocusableMixin
434434

435435
/// The message to display when character counter is shown.
436436
///
437-
/// Always shows [currentCount] but will ignore [maxCount] if it is null.
437+
/// The character count in the form "[currentCount] / [maxCount]", such as
438+
/// `12 / 25`, when [maxCount] is non-null; otherwise simply "[currentCount]".
438439
String msgCharacterCounter(int currentCount, int maxCount) => maxCount == null
439440
? '$currentCount'
440441
: _msgCharacterCounter(currentCount, maxCount);

lib/material_input/material_input.dart

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -106,8 +106,8 @@ const String materialInputErrorKey = 'material-input-error';
106106
/// character counter panel.
107107
/// - `rows` -- If the input is multiline, how many lines there are.
108108
/// - `maxRows` -- If the input is multiline, the max number of lines.
109-
/// - `showCharacterCount` -- Whether or not the character count will be
110-
/// displayed when maxCount is null.
109+
/// - `showCharacterCount` -- Force the character count to be displayed if
110+
/// maxCount is null.
111111
///
112112
/// __Outputs:__
113113
///

0 commit comments

Comments
 (0)