resolveButtonStyle function

ButtonStyle resolveButtonStyle(
  1. ButtonStyle? first,
  2. ButtonStyle? second,
  3. ButtonStyle third
)

Implementation

ButtonStyle resolveButtonStyle(ButtonStyle? first, ButtonStyle? second, ButtonStyle third)
{
  if (first == null && second == null) return third;

  final resolve = makeResolver(first, second, third);

  return ButtonStyle(
    textStyle: resolve((style) => style.textStyle),
    backgroundColor: resolve((style) => style.backgroundColor),
    foregroundColor: resolve((style) => style.foregroundColor),
    overlayColor: resolveButtonRichStateProperty(first?.overlayColor, second?.overlayColor, third.overlayColor),
    shadowColor: resolve((style) => style.shadowColor),
    elevation: resolve((style) => style.elevation),
    padding: resolve((style) => style.padding),
    minimumSize: resolve((style) => style.minimumSize),
    fixedSize: resolve((style) => style.fixedSize),
    maximumSize: resolve((style) => style.maximumSize),
    side: resolve((style) => style.side),
    shape: resolve((style) => style.shape),
    mouseCursor: resolve((style) => style.mouseCursor),
    visualDensity: resolve((style) => style.visualDensity),
    tapTargetSize: resolve((style) => style.tapTargetSize),
    animationDuration: resolve((style) => style.animationDuration),
    enableFeedback: resolve((style) => style.enableFeedback),
    alignment: resolve((style) => style.alignment),
    splashFactory: resolve((style) => style.splashFactory),
  );
}