Skip to content

[M3] Cannot override checkbox side property for error states  #118385

@esouthren

Description

@esouthren

In Material 3, if a user attempts to create a MaterialStateBorderSide override for the checkbox side property, it does not take effect if specified for error states.

See https://dartpad.dev/?id=fbe8db2ca18aedb667964643c29a667e&channel=beta for a working example of this issue.

It works correctly for other properties (fill color, etc) as those fields specifically check for isError in the widget and add it to the states, e.g this current example for checkbox color:

final Set<MaterialState> checkStates =  widget.isError ? (states..add(MaterialState.error)) : states;
final Color effectiveCheckColor = widget.checkColor ??  checkboxTheme.checkColor?.resolve(checkStates) ??
        defaults.checkColor!.resolve(checkStates)!;

A similar check for error needs to be added to the _resolveSide method.

Metadata

Metadata

Assignees

No one assigned

    Labels

    f: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.

    Type

    No type

    Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions