Taha Tesser
c386acca54
Fix MaterialStateBorderSide lerp in the Checkbox and chips (#148124)
fixes [`Checkbox` and Chips side with `MaterialStateBorderSide` doesn't lerp in their theme](https://github.com/flutter/flutter/issues/135136)
### Code sample
<details>
<summary>expand to view the code sample</summary>
```dart
import 'package:flutter/material.dart';
import 'package:flutter_test/flutter_test.dart';
void main() {
testWidgets('test', (WidgetTester tester) async {
late ColorScheme colorScheme;
Widget buildCheckbox({required Color seedColor}) {
colorScheme = ColorScheme.fromSeed(seedColor: seedColor);
return MaterialApp(
theme: ThemeData(
colorScheme: colorScheme,
checkboxTheme: CheckboxThemeData(
side: MaterialStateBorderSide.resolveWith(
(Set<MaterialState> states) {
return BorderSide(
color: colorScheme.primary,
width: 4.0,
);
}),
),
),
home: Scaffold(
body: Center(
child: Checkbox(
value: false,
onChanged: (_) {},
),
),
),
);
}
await tester.pumpWidget(buildCheckbox(seedColor: Colors.red));
await tester.pumpAndSettle();
RenderBox getCheckboxRenderer() {
return tester.renderObject<RenderBox>(find.byType(Checkbox));
}
expect(getCheckboxRenderer(), paints..drrect(color: colorScheme.primary));
await Future<void>.delayed(const Duration(seconds: 3));
await tester.pumpWidget(buildCheckbox(seedColor: Colors.blue));
await tester.pump();
await Future<void>.delayed(const Duration(seconds: 3));
expect(getCheckboxRenderer(), paints..drrect(color: colorScheme.primary));
});
}
```
</details>
| Before | After |
| --------------- | --------------- |
| <img src="https://github.com/flutter/flutter/assets/48603081/6df34104-37ba-4a82-b5cb-7ed4f887992a" /> | <img src="https://github.com/flutter/flutter/assets/48603081/44359248-a101-46eb-a85a-77f976da5f0f" /> |
2024-05-10 23:37:05 +00:00
..
2024-04-09 19:35:07 +00:00
2024-02-28 13:55:50 -08:00
2024-04-09 19:35:07 +00:00
2024-01-31 16:13:17 +00:00
2024-01-31 16:13:17 +00:00
2024-03-24 18:01:17 +00:00
2024-01-24 16:49:18 +00:00
2024-04-25 10:32:45 -07:00
2024-04-25 10:32:45 -07:00
2024-04-09 19:35:07 +00:00
2024-04-18 07:21:18 -07:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-04-24 10:11:56 -07:00
2024-03-19 17:58:13 +00:00
2024-04-16 07:53:27 -07:00
2024-02-28 13:55:50 -08:00
2024-01-19 18:29:07 +00:00
2024-03-19 17:58:13 +00:00
2024-03-01 12:44:29 +00:00
2024-05-09 16:31:54 -06:00
2024-05-09 16:31:54 -06:00
2024-02-12 10:07:51 -08:00
2024-02-28 13:55:50 -08:00
2024-05-10 23:37:05 +00:00
2024-05-08 00:27:59 +00:00
2024-05-10 23:37:05 +00:00
2024-02-28 13:55:50 -08:00
2024-03-24 18:01:17 +00:00
2024-04-03 15:54:34 +00:00
2024-04-01 09:42:51 +00:00
2024-04-18 07:16:32 -07:00
2024-04-29 22:14:01 +00:00
2024-04-26 04:18:24 +00:00
2024-04-29 18:18:06 +00:00
2024-02-13 00:12:02 +00:00
2024-05-10 22:08:59 +00:00
2024-01-16 10:08:27 +00:00
2024-05-09 16:31:54 -06:00
2024-05-09 16:31:54 -06:00
2024-04-08 20:47:13 +00:00
2024-05-10 21:55:49 +00:00
2024-02-28 13:55:50 -08:00
2024-02-07 13:57:21 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-01-22 10:01:05 +00:00
2024-05-09 15:35:07 +00:00
2024-05-04 18:19:29 -07:00
2024-01-22 11:13:31 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-04-22 16:49:19 +00:00
2024-01-24 16:13:26 +00:00
2024-01-24 16:13:26 +00:00
2024-03-19 17:58:13 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 11:56:32 +00:00
2024-04-22 20:40:33 -07:00
2024-04-09 19:35:07 +00:00
2024-02-07 02:44:21 +00:00
2024-04-09 19:35:07 +00:00
2024-04-22 16:49:19 +00:00
2024-02-27 22:49:13 +00:00
2024-05-03 15:16:05 +00:00
2024-04-09 19:35:07 +00:00
2024-03-19 17:58:16 +00:00
2024-02-21 08:59:24 +00:00
2024-04-03 15:49:38 -07:00
2024-03-19 17:58:13 +00:00
2024-05-07 02:39:09 +00:00
2024-04-09 19:35:07 +00:00
2024-03-11 23:04:57 +00:00
2024-04-09 19:35:07 +00:00
2024-03-19 17:58:13 +00:00
2024-04-09 19:35:07 +00:00
2024-03-19 17:58:13 +00:00
2024-05-08 11:05:24 +00:00
2024-04-18 08:03:19 -07:00
2024-04-09 19:35:07 +00:00
2024-02-28 13:55:50 -08:00
2024-05-04 18:23:39 -07:00
2024-03-13 18:07:59 +00:00
2024-03-27 16:43:10 -07:00
2024-04-17 11:03:48 -07:00
2024-03-28 01:20:55 +00:00
2024-03-19 17:58:13 +00:00
2024-03-27 16:43:10 -07:00
2024-03-28 22:22:20 +00:00
2024-02-12 10:07:51 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-05-08 19:04:17 +00:00
2024-04-23 11:14:19 -07:00
2024-04-29 08:26:19 +00:00
2024-03-13 16:31:50 +00:00
2024-03-19 17:58:13 +00:00
2024-05-03 09:34:11 -07:00
2024-03-19 17:58:13 +00:00
2024-02-27 22:49:13 +00:00
2024-01-17 22:49:04 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 11:56:32 +00:00
2024-04-24 09:06:17 -07:00
2024-04-27 17:30:58 -07:00
2024-03-19 17:58:13 +00:00
2024-05-08 07:34:05 +00:00
2024-04-15 16:06:07 +00:00
2024-03-28 01:20:55 +00:00
2024-02-12 10:07:51 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-05-07 20:54:09 +00:00
2024-05-07 20:54:09 +00:00
2024-04-17 07:59:07 +00:00
2024-04-09 19:35:07 +00:00
2024-02-28 13:55:50 -08:00
2024-05-04 20:01:33 -07:00
2024-03-01 06:40:47 +00:00
2024-03-06 20:41:04 +00:00
2024-02-28 13:55:50 -08:00
2024-02-28 13:55:50 -08:00
2024-03-19 17:58:13 +00:00
2024-04-09 19:35:07 +00:00
2024-04-09 19:35:07 +00:00
2024-02-23 19:02:22 +00:00
2024-03-28 01:20:55 +00:00
2024-04-16 12:15:37 -07:00
2024-02-21 00:34:11 +00:00