Skip to content

Clarify ButtonThemeData usage and documentation #98691

@Piinks

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

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/f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: 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