Taha Tesser
4648f54430
Fix chips onDeleted callback don't show the delete button when disabled (#137685)
fixes [Chips with `onDeleted` callback should show the delete button in the `disabled` state](https://github.com/flutter/flutter/issues/136638)
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
void main() => runApp(const MyApp());
class MyApp extends StatelessWidget {
const MyApp({super.key});
@override
Widget build(BuildContext context) {
return const MaterialApp(
debugShowCheckedModeBanner: false,
home: 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: () {},
),
FilterChip(
avatar: const Icon(Icons.favorite_rounded),
label: const Text('FilterChip'),
onSelected: null,
onDeleted: () {},
),
],
),
),
);
}
}
```
</details>
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/8bd458de-cfd2-44f0-a0dd-a8298938c61f" /> | <img src="https://github.com/flutter/flutter/assets/48603081/afca0684-b061-416b-b029-5316588c6888" /> |
2023-11-29 23:57:05 +00:00
..
2023-09-11 09:42:27 -07:00
2023-10-12 14:17:56 +00:00
2023-10-24 22:35:05 +00:00
2023-08-31 10:19:13 -07:00
2023-08-31 10:19:13 -07:00
2023-11-20 15:24:41 -08:00
2023-08-31 10:19:13 -07:00
2023-11-20 22:18:38 +00:00
2023-11-03 22:25:37 +00:00
2023-11-03 22:25:37 +00:00
2023-08-31 10:19:13 -07:00
2023-09-11 09:42:27 -07:00
2023-09-18 13:45:38 -07:00
2023-11-01 23:29:49 +00:00
2023-09-01 08:53:53 -07:00
2023-10-10 18:11:23 -07:00
2023-10-10 18:11:23 -07:00
2023-10-10 18:11:23 -07:00
2023-11-29 23:57:05 +00:00
2023-10-12 14:17:56 +00:00
2023-10-12 14:17:56 +00:00
2023-10-09 10:05:28 +00:00
2023-10-31 23:27:03 +00:00
2023-10-27 12:04:07 +03:00
2023-09-15 08:55:50 -07:00
2023-10-10 08:32:01 -07:00
2023-10-06 11:26:06 +00:00
2023-11-03 22:25:37 +00:00
2023-11-14 17:55:05 +00:00
2023-09-05 13:45:12 -07:00
2023-09-01 08:53:53 -07:00
2023-09-01 08:53:53 -07:00
2023-09-05 13:45:12 -07:00
2023-09-29 18:15:53 +00:00
2023-09-05 13:45:12 -07:00
2023-10-10 10:05:51 -07:00
2023-10-19 18:32:50 +00:00
2023-10-18 20:13:08 +00:00
2023-10-10 10:05:51 -07:00
2023-11-29 07:05:42 +00:00
2023-09-05 13:45:12 -07:00
2023-11-20 23:50:49 +00:00
2023-11-29 07:05:42 +00:00
2023-11-29 23:57:05 +00:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-10-11 07:19:30 +00:00
2023-09-11 09:42:27 -07:00
2023-09-11 09:42:27 -07:00
2023-10-09 09:10:23 -07:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-11-28 17:59:19 +00:00
2023-11-17 18:50:33 +00:00
2023-10-10 18:11:23 -07:00
2023-11-29 23:57:05 +00:00
2023-10-23 14:37:43 -07:00
2023-11-28 05:20:07 +00:00
2023-09-11 09:42:27 -07:00
2023-09-05 13:45:12 -07:00
2023-10-10 18:11:23 -07:00
2023-09-21 10:06:21 -07:00
2023-11-03 12:34:16 -07:00
2023-10-23 15:45:46 +00:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-11-27 21:02:35 +00:00
2023-11-27 21:02:35 +00:00
2023-09-22 08:03:02 +00:00
2023-09-05 13:45:12 -07:00
2023-10-16 08:48:13 +00:00
2023-09-05 13:45:12 -07:00
2023-11-29 07:05:42 +00:00
2023-09-22 15:27:05 -07:00
2023-09-11 09:42:27 -07:00
2023-09-05 13:45:12 -07:00
2023-10-18 15:44:31 +00:00
2023-11-03 22:25:37 +00:00
2023-11-20 15:24:41 -08:00
2023-10-26 23:55:38 +00:00
2023-09-05 13:45:12 -07:00
2023-10-10 18:11:23 -07:00
2023-09-28 16:06:53 +00:00
2023-10-26 16:23:33 -07:00
2023-11-10 13:14:14 -08:00
2023-11-03 22:25:37 +00:00
2023-09-05 13:45:12 -07:00
2023-09-07 17:50:45 -07:00
2023-08-31 08:52:06 -07:00
2023-11-28 18:38:55 +00:00
2023-09-11 09:42:27 -07:00
2023-11-29 08:29:06 +00:00
2023-10-23 14:37:43 -07:00
2023-10-16 21:03:59 +00:00
2023-09-11 09:42:27 -07:00
2023-09-28 01:42:16 +00:00
2023-11-10 13:14:14 -08:00
2023-10-18 16:03:08 +00:00
2023-10-12 01:17:07 +00:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:41:10 -07:00
2023-11-07 10:26:23 -08:00
2023-11-07 10:26:23 -08:00
2023-11-07 10:26:23 -08:00
2023-10-26 23:55:38 +00:00
2023-09-22 15:27:05 -07:00
2023-09-07 17:50:45 -07:00
2023-10-26 23:55:38 +00:00
2023-11-29 07:05:42 +00:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-09-11 09:42:27 -07:00
2023-09-05 13:45:12 -07:00
2023-11-29 08:25:20 +00:00
2023-09-11 09:42:27 -07:00
2023-10-26 00:26:20 +00:00
2023-09-05 13:45:12 -07:00
2023-09-05 13:45:12 -07:00
2023-09-11 09:42:27 -07:00
2023-11-07 10:26:23 -08:00
2023-09-05 13:45:12 -07:00
2023-11-29 21:03:32 +00:00
2023-10-10 11:05:26 -07:00
2023-10-23 14:37:43 -07:00
2023-09-11 09:42:27 -07:00
2023-11-10 13:14:14 -08:00
2023-10-06 22:12:20 +00:00
2023-11-29 21:03:32 +00:00
2023-10-10 18:11:23 -07:00
2023-09-05 13:45:12 -07:00