Skip to content

Commit c6f2cea

Browse files
authored
Reland: Added ButtonStyle.foregroundBuilder and ButtonStyle.backgroundBuilder (#142762)
Reland flutter/flutter#141818 with a fix for a special case: If only `background` is specified for `TextButton.styleFrom` or `OutlinedButton.styleFrom` it applies the button's disabled state, i.e. as if the same value had been specified for disabledBackgroundColor. The change relative to #141818 is the indicated line below: ```dart final MaterialStateProperty<Color?>? backgroundColorProp = switch ((backgroundColor, disabledBackgroundColor)) { (null, null) => null, (_, null) => MaterialStatePropertyAll<Color?>(backgroundColor), // ADDED THIS LINE (_, _) => _TextButtonDefaultColor(backgroundColor, disabledBackgroundColor), }; ``` This backwards incompatibility cropped up in an internal test, see internal Google issue b/323399158.
1 parent c13ebf1 commit c6f2cea

15 files changed

+1618
-188
lines changed

dev/bots/check_code_samples.dart

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -374,7 +374,6 @@ final Set<String> _knownMissingTests = <String>{
374374
'examples/api/test/material/checkbox/checkbox.1_test.dart',
375375
'examples/api/test/material/checkbox/checkbox.0_test.dart',
376376
'examples/api/test/material/navigation_rail/navigation_rail.extended_animation.0_test.dart',
377-
'examples/api/test/material/text_button/text_button.0_test.dart',
378377
'examples/api/test/rendering/growth_direction/growth_direction.0_test.dart',
379378
'examples/api/test/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.0_test.dart',
380379
'examples/api/test/rendering/sliver_grid/sliver_grid_delegate_with_fixed_cross_axis_count.1_test.dart',

0 commit comments

Comments
 (0)