Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Clarify MaterialButton usage and documentation #98693

Open
@Piinks

Description

@Piinks

From @rydmike in #98537 (comment)

MaterialButton

Next comes the question of the fate of the MaterialButton the parent class for the buttons to be removed.

It is also in the docs marked as obsolete but not deprecated.

/// ### This class is obsolete.

Will it remain available or be removed? My conclusion is, it will stay, even if it does not correctly implement or enable users to create Material buttons, plus its children will be gone due to same reasons. Considering this, it seems a bit illogical for it to remain, but it would be difficult to remove without a number of other changes discussed further below.

My search did no reveal any other usages and mentions of MaterialButton than in its child buttons that will be removed, and in ButtonThemeData itself, in a large number of odd looking getters.


Removed quoted section here as a separate issue: #98692


The fact that ButtonThemeData, that needs to remain for ButtonBar and DropdownButton, itself depends on MaterialButton, also makes it impossible to remove the "obsolete" MaterialButton parent of all the 3 buttons now being removed.

In Material there is in the MaterialType enum a doc comment to MaterialButton in enum value button.

/// Rounded edges, no color by default (used for [MaterialButton] buttons).

So I checked for references to MaterialType.button, other than in Material it is only used by RawMatererialButton and ButtonStyleButton. maybe consider updating the above doc ref to them instead of MaterialButton.

If the MaterialButton is considered and marked as obsolete in the docs, which imo is correct, thus maybe consider deprecating it and plan for changes need to be able to remove it.


Similar to #98691, obsolete is not a term folks know what to do with. What does it mean when other parts of the framework still depend on it? Some guidance would be helpful to add. 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