这是indexloc提供的服务,不要输入任何密码
Skip to content

Conversation

@bleroux
Copy link
Contributor

@bleroux bleroux commented Sep 22, 2025

Description

This PR adds some documentation to TextField.maxLength mentionning how to remove the counter.
See #99914 (comment) for context.

Related Issue

Fixes TextField hint and input text go outside of given constraints

Tests

Documentation only.

@github-actions github-actions bot added a: text input Entering text in a text field or keyboard related problems framework flutter/packages/flutter repository. See also f: labels. f: material design flutter/packages/flutter/material repository. labels Sep 22, 2025
Copy link
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request adds documentation to TextField.maxLength explaining how to hide the character counter. The information is helpful and correct. I've suggested a small change to improve the readability and flow of the documentation paragraph.

@bleroux bleroux requested a review from justinmc September 22, 2025 19:03
Copy link
Contributor

@justinmc justinmc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM 👍 . Good call, we should definitely mention this.

/// field showing how many characters have been entered. If set to a number
/// greater than 0, it will also display the maximum number allowed. If set
/// to [TextField.noMaxLength] then only the current character count is displayed.
/// To remove the counter, set [InputDecoration.counterText] to an empty string.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would it be worth it to also mention that you can return null from buildCounter or is that overkill here?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Great! I think it makes sense to mention buildCounter. I will update the PR.

@bleroux bleroux force-pushed the doc_mention_how_to_remove_counter_in_TextField.maxLength branch from 0bdf67e to daf8d76 Compare September 23, 2025 06:37
@bleroux bleroux added the autosubmit Merge PR when tree becomes green via auto submit App label Sep 23, 2025
@auto-submit auto-submit bot added this pull request to the merge queue Sep 23, 2025
Merged via the queue into flutter:master with commit 2125f6f Sep 23, 2025
78 checks passed
@flutter-dashboard flutter-dashboard bot removed the autosubmit Merge PR when tree becomes green via auto submit App label Sep 23, 2025
@bleroux bleroux deleted the doc_mention_how_to_remove_counter_in_TextField.maxLength branch September 23, 2025 09:05
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Sep 23, 2025
auto-submit bot pushed a commit to flutter/packages that referenced this pull request Sep 24, 2025
…10067)

Manual roll requested by bmparr@google.com

flutter/flutter@9ff2767...4a04204

2025-09-23 mohellebiabdessalem@gmail.com Simplify asserts in `FlutterMutatorTest` (flutter/flutter#175730)
2025-09-23 mohellebiabdessalem@gmail.com Improve code quality in `AccessibilityBridgeTest.java` (flutter/flutter#175718)
2025-09-23 mohellebiabdessalem@gmail.com Fix linter issues in `VsyncWaiterTest` Capital L for long values (flutter/flutter#175780)
2025-09-23 mohellebiabdessalem@gmail.com Fix wrong order of asserts arguments (flutter/flutter#175726)
2025-09-23 mohellebiabdessalem@gmail.com Simplify test asserts and use lambdas  (flutter/flutter#175727)
2025-09-23 mohellebiabdessalem@gmail.com Remove unused imports, fix assertion order, add non null annotations to `ImageReaderPlatformViewRenderTargetTest.java` (flutter/flutter#175723)
2025-09-23 mohellebiabdessalem@gmail.com Remove unnecessary `String.valueOf` in `KeyboardManager.java` (flutter/flutter#175502)
2025-09-23 mohellebiabdessalem@gmail.com Fix outdated link of `intl` package to point to the correct new location  (flutter/flutter#174498)
2025-09-23 engine-flutter-autoroll@skia.org Roll Packages from 45c9a84 to 3413b65 (4 revisions) (flutter/flutter#175854)
2025-09-23 mohellebiabdessalem@gmail.com Fix typo in tests `README` (flutter/flutter#175788)
2025-09-23 byoungchan.lee@gmx.com Update maximum known Gradle version to 9.1.0 (flutter/flutter#175543)
2025-09-23 engine-flutter-autoroll@skia.org Roll Dart SDK from 9e943fe076c8 to 14b4ced3022a (5 revisions) (flutter/flutter#175843)
2025-09-23 bruno.leroux@gmail.com Document how to hide counter in TextField.maxLength (flutter/flutter#175797)
2025-09-23 bruno.leroux@gmail.com [a11y-app] Fix Autocomplete semantics label (flutter/flutter#175409)
2025-09-23 engine-flutter-autoroll@skia.org Roll Fuchsia Linux SDK from CcCe3HpQtBYhTZscb... to naeytagBIBEpKgZNZ... (flutter/flutter#175824)
2025-09-23 engine-flutter-autoroll@skia.org Roll Skia from a38a531dec1d to cabeab8cb22c (16 revisions) (flutter/flutter#175822)
2025-09-23 jiahaog@users.noreply.github.com Load fonts in the order addFont is called (flutter/flutter#174253)
2025-09-22 137456488+flutter-pub-roller-bot@users.noreply.github.com Roll pub packages (flutter/flutter#175545)
2025-09-22 mohellebiabdessalem@gmail.com Remove `name` field form `SupportedPlatform` enum (flutter/flutter#175611)
2025-09-22 mdebbar@google.com [web] Cleanup opportunities post renderer unification (flutter/flutter#174659)
2025-09-22 mohellebiabdessalem@gmail.com Update `KeyChannelResponder.java`  to use method reference  (flutter/flutter#175510)
2025-09-22 dominik@roszkowski.dev Update docs/engine/contributing/Compiling-the-engine.md with macOS build steps (flutter/flutter#175716)
2025-09-22 bkonyi@google.com [ Widget Preview ] Allow for custom `Preview` annotations, add support for runtime transformations (flutter/flutter#175535)
2025-09-22 mohellebiabdessalem@gmail.com Remove unnecessary public modifier in `KeyboardManager.java` (flutter/flutter#175500)
2025-09-22 muhatashim@google.com bump robolectric and java to 21 (flutter/flutter#175550)
2025-09-22 dixita0607@users.noreply.github.com Fix: Update docs tool tag to sample in ImageProvider (flutter/flutter#175256)
2025-09-22 stuartmorgan@google.com  Roll Packages from 3d5c419 to 45c9a84 (flutter/flutter#175794)
2025-09-21 dkwingsmt@users.noreply.github.com Correctly implement PlatformViews' cursors on Web (flutter/flutter#174300)

If this roll has caused a breakage, revert this CL and stop the roller
using the controls here:
https://autoroll.skia.org/r/flutter-packages
Please CC bmparr@google.com,stuartmorgan@google.com on the revert to ensure that a human
is aware of the problem.

To file a bug in Packages: https://github.com/flutter/flutter/issues/new/choose

To report a problem with the AutoRoller itself, please file a bug:
https://issues.skia.org/issues/new?component=1389291&template=1850622

Documentation for the AutoRoller is here:
https://skia.googlesource.com/buildbot/+doc/main/autoroll/README.md
Jaineel-Mamtora pushed a commit to Jaineel-Mamtora/flutter_forked that referenced this pull request Sep 24, 2025
## Description

This PR adds some documentation to TextField.maxLength mentionning how
to remove the counter.
See
flutter#99914 (comment)
for context.

## Related Issue

Fixes [TextField hint and input text go outside of given
constraints](flutter#99914)

## Tests

Documentation only.
engine-flutter-autoroll added a commit to engine-flutter-autoroll/packages that referenced this pull request Nov 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

a: text input Entering text in a text field or keyboard related problems f: material design flutter/packages/flutter/material repository. framework flutter/packages/flutter repository. See also f: labels.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TextField hint and input text go outside of given constraints.

2 participants