Skip to content

Clarify ButtonThemeData usage and documentation #98691

Open

Description

@Piinks

Feedback from @rydmike in #98537 (comment)

ButtonThemeData

The ButtonThemeData class is marked as obsolete in the docs, but not as deprecated.

In its theme ButtonTheme:

/// ### This class is obsolete.

And in its theme data ButtonThemeData:

/// ### This class is obsolete.

In addition to the buttons that will be removed [FlatButton, OutlineButton, RaisedButton], the theme and theme data is used by the buttons' parent class MaterialButton and the ButtonBar and its theme ButtonBarTheme, plus as far I could notice DropdownButton uses one property from it as well.

Instead of having the docs above mention that it is used by buttons that will no longer exist, maybe consider updating the doc comment and instead mention the usage by ButtonBar, DropdownButton and MaterialButton, if it will remain. It kind of will have to, but more on that below.

Perhaps for the update also consider updating the doc comment for the buttonTheme property in ThemeData to better reflects its remaining usage in ButtonBar, DropdownButton and MaterialButton

Some of these doc updates will be completed in the course of resolving #98537

/// Defines the default configuration of button widgets, like [RaisedButton]


In general, I think the current use case is unclear to users, obsolete is not deprecated, but it's not really obsolete either if other parts of the framework still use ButtonThemeData. There is definitely some opportunity for better clarity and guidance here - even if that is just to say we plan to make more changes in the future that will eventually remove this class.

cc @HansMuller @darrenaustin

Activity

  1. added
    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
    a: annoyanceRepeatedly frustrating issues with non-experimental functionality
    P2Important issues not at the top of the work list
    on Feb 17, 2022
  2. Piinks commented on Feb 17, 2022

    @Piinks
    ContributorAuthor

    If this is planned to be removed eventually, see full linked comment above, just that would be a beneficial bit of guidance.

  3. self-assigned this
    on Feb 18, 2022
  4. Piinks commented on Feb 24, 2022

    @Piinks
    ContributorAuthor

    Confirmed with @HansMuller yesterday, this should be deprecated

  5. removed their assignment
    on Oct 3, 2022
  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: annoyanceRepeatedly frustrating issues with non-experimental functionalitya: qualityA truly polished experienced: api docsIssues with https://api.flutter.dev/p: material_uimaterial_ui package in flutter/packagespackageflutter/packages repository. See also p: labels.team-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions