Skip to content

lerp of ChipThemeData.side is wrong when b is null #173161

Description

@ValentinVignal

Steps to reproduce

The lerp method of ChipThemeData for side doesn't work well when b is null.

Expected results

I expect the transistion to be smooth

Actual results

There is a back and forth in the transition

Code sample

Code sample
import 'package:flutter/material.dart';

void main() => runApp(const MyApp());

class MyApp extends StatefulWidget {
  const MyApp({super.key});

  @override
  State<MyApp> createState() => _MyAppState();
}

class _MyAppState extends State<MyApp> {
  BorderSide? _side;
  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      theme: ThemeData(chipTheme: ChipThemeData(side: _side)),
      home: Scaffold(
        body: Center(
          child: ActionChip(
            label: Text('Chip'),
            onPressed: () {
              setState(() {
                if (_side == null) {
                  _side = BorderSide(width: 5, color: Colors.red);
                } else {
                  _side = null;
                }
              });
            },
          ),
        ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration
Screen.Recording.2025-08-02.at.6.36.40.PM.mov

Activity

  1. darshankawar commented on Aug 4, 2025

    @darshankawar
    Member

    Thanks for the report and potential fix.

  2. added
    p: material_uimaterial_ui package in flutter/packages
    frameworkflutter/packages/flutter repository. See also f: labels.
    team-designOwned by Design Languages team
    and removed
    in triagePresently being triaged by the triage team
    on Aug 4, 2025
  3. added
    P2Important issues not at the top of the work list
    triaged-designTriaged by Design Languages team
    on Aug 6, 2025
  4. added
    r: fixedIssue is closed as already fixed in a newer version
    on Aug 14, 2025
  5. github-actions commented on Aug 28, 2025

    @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.

  6. locked as resolved and limited conversation to collaborators on Aug 28, 2025
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 listframeworkflutter/packages/flutter repository. See also f: labels.p: material_uimaterial_ui package in flutter/packagesr: fixedIssue is closed as already fixed in a newer versionteam-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