Skip to content

Chips with onDeleted callback should show the delete button in the disabled state #136638

@TahaTesser

Description

@TahaTesser

Is there an existing issue for this?

Steps to reproduce

At the moments chips with onDeleted don't show the delete button icon when disabled. This matches the Flutter documentation https://master-api.flutter.dev/flutter/material/DeletableChipAttributes/onDeleted.html

However when looking the specs, I can see chips show the delete button icon in the disabled state

Screenshot 2023-10-16 at 14 54 32

But this is what we see in Flutter

Screenshot 2023-10-16 at 15 12 34

Expected results

Chips show the delete icon button when disabled

Actual results

Chips don't show the delete icon button when disabled

Code sample

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

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

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

  @override
  Widget build(BuildContext context) {
    return MaterialApp(
      debugShowCheckedModeBanner: false,
      theme: ThemeData(
        colorScheme: ColorScheme.fromSeed(seedColor: Colors.green).copyWith(
          onSurfaceVariant: const Color(0xffff0000),
          onSecondaryContainer: const Color(0xff0000ff),
        ),
      ),
      home: const Example(),
    );
  }
}

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

  @override
  State<Example> createState() => _ExampleState();
}

class _ExampleState extends State<Example> {
  @override
  Widget build(BuildContext context) {
    return Scaffold(
      body: Center(
        child: Column(
              mainAxisAlignment: MainAxisAlignment.spaceEvenly,
              children: <Widget>[
                RawChip(
                  avatar: const Icon(Icons.favorite_rounded),
                  label: const Text('RawChip'),
                  onSelected: null,
                  isEnabled: false,
                  onDeleted: () {},
                ),

                InputChip(
                  avatar: const Icon(Icons.favorite_rounded),
                  label: const Text('InputChip'),
                  isEnabled: false,
                  onPressed: null,
                  onDeleted: () {},
                ),

              ],
            ),
      ),
    );
  }
}

Screenshots or Video

Screenshots / Video demonstration

[Upload media here]

Logs

Logs
[Paste your logs here]

Flutter Doctor output

Doctor output
[✓] Flutter (Channel master, 3.16.0-11.0.pre.69, on macOS 14.0 23A344 darwin-arm64, locale en-US)
    • Flutter version 3.16.0-11.0.pre.69 on channel master at /Users/tahatesser/Code/flutter
    • Upstream repository [email protected]:TahaTesser/flutter.git
    • FLUTTER_GIT_URL = [email protected]:TahaTesser/flutter.git
    • Framework revision b66ab70c09 (4 hours ago), 2023-10-16 02:37:09 -0400
    • Engine revision 539ad5b232
    • Dart version 3.3.0 (build 3.3.0-27.0.dev)
    • DevTools version 2.28.1

[✓] Android toolchain - develop for Android devices (Android SDK version 34.0.0)
    • Android SDK at /Users/tahatesser/Code/android-sdk
    • Platform android-34, build-tools 34.0.0
    • ANDROID_SDK_ROOT = /Users/tahatesser/Code/android-sdk
    • Java binary at: /Applications/Android Studio.app/Contents/jbr/Contents/Home/bin/java
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)
    • All Android licenses accepted.

[✓] Xcode - develop for iOS and macOS (Xcode 15.0)
    • Xcode at /Applications/Xcode.app/Contents/Developer
    • Build 15A240d
    • CocoaPods version 1.13.0

[✓] Chrome - develop for the web
    • Chrome at /Applications/Google Chrome.app/Contents/MacOS/Google Chrome

[✓] Android Studio (version 2022.3)
    • Android Studio at /Applications/Android Studio.app/Contents
    • Flutter plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/9212-flutter
    • Dart plugin can be installed from:
      🔨 https://plugins.jetbrains.com/plugin/6351-dart
    • Java version OpenJDK Runtime Environment (build 17.0.6+0-17.0.6b829.9-10027231)

[✓] VS Code (version 1.83.1)
    • VS Code at /Applications/Visual Studio Code.app/Contents
    • Flutter extension version 3.74.0

[✓] Connected device (2 available)
    • macOS (desktop) • macos  • darwin-arm64   • macOS 14.0 23A344 darwin-arm64
    • Chrome (web)    • chrome • web-javascript • Google Chrome 117.0.5938.149

[✓] Network resources
    • All expected network resources are available.

• No issues found

Metadata

Metadata

Assignees

Labels

P2Important issues not at the top of the work listc: proposalA detailed proposal for a change to Flutterf: material designflutter/packages/flutter/material repository.frameworkflutter/packages/flutter repository. See also f: labels.r: fixedIssue is closed as already fixed in a newer versionteam-designOwned by Design Languages teamtriaged-designTriaged by Design Languages team

Type

No type

Projects

Status

Done (PR merged)

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions