Skip to content

[M3] Checkbox MaterialStateBorderSide does not lerp correctly #118724

Closed

Description

@esouthren

A null operator is thrown in checkbox_theme.dart at this point -

  static BorderSide? _lerpSides(BorderSide? a, BorderSide? b, double t) {
    if (a == null && b == null) {
      return null;
    }
    return BorderSide.lerp(a!, b!, t);
  }

-because BorderSide.lerp immediately asserts that a and b are both non-null.

In M3, a MaterialStateBorderSide value can now be provided to the theme's side property, which causes this assertion to throw.

The _lerpSides method should be modified to return null when a == null || a == null, not &&.

Activity

  1. self-assigned this
    on Jan 18, 2023
  2. github-actions commented on Mar 4, 2023

    @github-actions

    This thread has been automatically locked since there has not been any recent activity after it was closed. If you are still experiencing a similar issue, please open a new bug, including the output of flutter doctor -v and a minimal reproduction of the issue.

  3. locked as resolved and limited conversation to collaborators on Mar 4, 2023
  4. moved this to ✅ Done in Material 3on Sep 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

p: material_uimaterial_ui package in flutter/packages

Type

No type

Projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions