Skip to content

Improve documentation of TextField's decoration property interplay with Theme.inputDecorationTheme #159629

Open

Description

@Lootwig

Use case

The current documentation of flutter's TextField contains no mention of the fact that any explicit decoration is merged with whatever additional decorations are defined in the surrounding theme, making it unnecessarily difficult to debug why e.g. trying to remove a field's border (if defined in the theme) is impossible without wrapping the widget with an additional Theme containing explicit InputBorder.none values.

Proposal

As a bare minimum, some form of notice should be added to the decoration property informing about the potential need for inserting an applied-property-clearing Theme wrapper surrounding the widget.

Ideally though, users should have a less verbose way of specifying whether to merge or fully replace the active InputDecorationTheme either when creating, or when applying an InputDecoration, e.g. with a bool? mergeWithTheme on all constructors, while applying more intuitive defaults (looking at the InputDecoration.collapsed() named constructor, that would be a false rather than a true)

EDIT: Note, I got started creating a small example on https://dartpad.dev to illustrate the issue, but writing code containing a textfield over there is an absolute nightmare once "Run" is executed due to the textfield acting as a cursor magnet making further code edits an incredibly frustrating experience :(

Activity

  1. added
    in triagePresently being triaged by the triage team
    frameworkflutter/packages/flutter repository. See also f: labels.
    p: material_uimaterial_ui package in flutter/packages
    d: api docsIssues with https://api.flutter.dev/
    a: qualityA truly polished experience
    c: proposalA detailed proposal for a change to Flutter
    team-designOwned by Design Languages team
    c: new featureNothing broken; request for a new capability
    and removed
    in triagePresently being triaged by the triage team
    on Dec 2, 2024
  2. added and removed
    team-designOwned by Design Languages team
    on Dec 4, 2024
  3. added
    P2Important issues not at the top of the work list
    on Jan 2, 2025
  4. justinmc commented on Jan 2, 2025

    @justinmc
    Contributor

    CC @victorsanni from triage.

  5. victorsanni commented on Jan 6, 2025

    @victorsanni
    Contributor

    Hi @Lootwig would you be interested in opening a PR to add the documentation for TextField.decoration?

  6. added
    packageflutter/packages repository. See also p: labels.
    and removed
    frameworkflutter/packages/flutter repository. See also f: labels.
    on Aug 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    P2Important issues not at the top of the work lista: qualityA truly polished experiencec: new featureNothing broken; request for a new capabilityc: proposalA detailed proposal for a change to Flutterd: api docsIssues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-text-inputOwned by Text Input teamtriaged-text-inputTriaged by Text Input team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions