Commit 4648f54
authored
Fix chips
fixes [Chips with `onDeleted` callback should show the delete button in the `disabled` state](flutter/flutter#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" /> |onDeleted callback don't show the delete button when disabled (#137685)1 parent 023e5ad commit 4648f54
File tree
4 files changed
+83
-9
lines changed- packages/flutter
- lib/src/material
- test/material
4 files changed
+83
-9
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2064 | 2064 | | |
2065 | 2065 | | |
2066 | 2066 | | |
2067 | | - | |
| 2067 | + | |
| 2068 | + | |
2068 | 2069 | | |
2069 | | - | |
| 2070 | + | |
2070 | 2071 | | |
2071 | | - | |
| 2072 | + | |
| 2073 | + | |
2072 | 2074 | | |
2073 | 2075 | | |
2074 | 2076 | | |
2075 | 2077 | | |
2076 | 2078 | | |
2077 | | - | |
| 2079 | + | |
2078 | 2080 | | |
2079 | 2081 | | |
2080 | 2082 | | |
2081 | 2083 | | |
2082 | 2084 | | |
2083 | | - | |
| 2085 | + | |
2084 | 2086 | | |
| 2087 | + | |
| 2088 | + | |
| 2089 | + | |
| 2090 | + | |
| 2091 | + | |
| 2092 | + | |
| 2093 | + | |
| 2094 | + | |
| 2095 | + | |
| 2096 | + | |
2085 | 2097 | | |
2086 | | - | |
| 2098 | + | |
| 2099 | + | |
2087 | 2100 | | |
2088 | 2101 | | |
2089 | 2102 | | |
| |||
2114 | 2127 | | |
2115 | 2128 | | |
2116 | 2129 | | |
2117 | | - | |
| 2130 | + | |
| 2131 | + | |
2118 | 2132 | | |
2119 | 2133 | | |
2120 | 2134 | | |
| |||
2123 | 2137 | | |
2124 | 2138 | | |
2125 | 2139 | | |
2126 | | - | |
| 2140 | + | |
2127 | 2141 | | |
2128 | | - | |
| 2142 | + | |
2129 | 2143 | | |
2130 | 2144 | | |
2131 | 2145 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
3653 | 3658 | | |
3654 | 3659 | | |
3655 | 3660 | | |
| 3661 | + | |
| 3662 | + | |
| 3663 | + | |
| 3664 | + | |
| 3665 | + | |
| 3666 | + | |
| 3667 | + | |
| 3668 | + | |
| 3669 | + | |
| 3670 | + | |
| 3671 | + | |
| 3672 | + | |
| 3673 | + | |
| 3674 | + | |
| 3675 | + | |
3656 | 3676 | | |
3657 | 3677 | | |
3658 | 3678 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
919 | 924 | | |
920 | 925 | | |
921 | 926 | | |
| 927 | + | |
| 928 | + | |
| 929 | + | |
| 930 | + | |
| 931 | + | |
| 932 | + | |
| 933 | + | |
| 934 | + | |
| 935 | + | |
| 936 | + | |
| 937 | + | |
| 938 | + | |
| 939 | + | |
| 940 | + | |
| 941 | + | |
922 | 942 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
5 | 10 | | |
6 | 11 | | |
7 | 12 | | |
| |||
411 | 416 | | |
412 | 417 | | |
413 | 418 | | |
| 419 | + | |
| 420 | + | |
| 421 | + | |
| 422 | + | |
| 423 | + | |
| 424 | + | |
| 425 | + | |
| 426 | + | |
| 427 | + | |
| 428 | + | |
| 429 | + | |
| 430 | + | |
| 431 | + | |
| 432 | + | |
| 433 | + | |
414 | 434 | | |
0 commit comments