• 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
..
custom_rules Loading commit data...
prepare_package Loading commit data...
test Loading commit data...
README.md Loading commit data...
accept_android_sdk_licenses.sh Loading commit data...
allowlist.dart Loading commit data...
analysis_options.yaml Loading commit data...
analyze.dart Loading commit data...
analyze_snippet_code.dart Loading commit data...
browser.dart Loading commit data...
check_code_samples.dart Loading commit data...
codelabs_build_test.sh Loading commit data...
docs.sh Loading commit data...
post_process_docs.dart Loading commit data...
prepare_package.dart Loading commit data...
pubspec.yaml Loading commit data...
run_command.dart Loading commit data...
service_worker_test.dart Loading commit data...
serviceaccount.enc Loading commit data...
test.dart Loading commit data...
tool_subsharding.dart Loading commit data...
unpublish_package.dart Loading commit data...
utils.dart Loading commit data...