applyDefaults method

PrettyQrDecoration applyDefaults(
  1. PrettyQrTheme theme
)

Creates a new QR code decoration that is a combination of this decoration and the given theme values.

Only null valued properties from this PrettyQrDecoration are replaced by the corresponding values from theme.

Implementation

PrettyQrDecoration applyDefaults(PrettyQrTheme theme) {
  final decoration = this;
  if (decoration == null) return theme.decoration;

  return theme.decoration.copyWith(
    shape: decoration.shape,
    image: decoration.image,
    background: decoration.background,
  );
}