• Hans Muller's avatar
    Reland: Added ButtonStyle.foregroundBuilder and ButtonStyle.backgroundBuilder (#142762) · c6f2cea6
    Hans Muller authored
    Reland https://github.com/flutter/flutter/pull/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.
    c6f2cea6
Name
Last commit
Last update
..
animation/animation_controller Loading commit data...
cupertino Loading commit data...
gestures/tap_and_drag Loading commit data...
material Loading commit data...
painting Loading commit data...
rendering Loading commit data...
sample_templates Loading commit data...
services Loading commit data...
ui/text Loading commit data...
widgets Loading commit data...
flutter_test_config.dart Loading commit data...
goldens_io.dart Loading commit data...
goldens_web.dart Loading commit data...