copyWithTheme method

BasicFlag copyWithTheme({
  1. FlagProperties? properties,
  2. DecoratedFlagInterface? theme,
  3. FlagPainterBuilder<CustomPainter>? elementsBuilder,
  4. CustomPainter? backgroundPainter,
  5. CustomPainter? foregroundPainter,
  6. FlagPainterBuilder<CustomPainter>? foregroundPainterBuilder,
  7. FlagWidgetBuilder<Widget>? foregroundWidgetBuilder,
  8. Key? key,
})

Creates a copy of this BasicFlag but with fields taken from a DecoratedFlagInterface theme.

  • properties: The properties of the flag.
  • theme: The theme data for the flag (any DecoratedFlagInterface).
  • elementsBuilder: A builder for the elements of the flag.
  • backgroundPainter: A custom painter for the background of the flag.
  • foregroundPainter: A custom painter for the foreground of the flag.
  • foregroundPainterBuilder: A builder for the foreground painter.
  • foregroundWidgetBuilder: A builder for the foreground widget.
  • key: The key for the widget.

Implementation

BasicFlag copyWithTheme({
  FlagProperties? properties,
  DecoratedFlagInterface? theme,
  FlagPainterBuilder? elementsBuilder,
  CustomPainter? backgroundPainter,
  CustomPainter? foregroundPainter,
  FlagPainterBuilder? foregroundPainterBuilder,
  FlagWidgetBuilder? foregroundWidgetBuilder,
  Key? key,
}) => BasicFlag(
  properties ?? this.properties,
  aspectRatio: theme?.aspectRatio ?? aspectRatio,
  decoration: theme?.decoration ?? decoration,
  decorationPosition: theme?.decorationPosition ?? decorationPosition,
  padding: theme?.padding ?? padding,
  elementsBuilder: elementsBuilder ?? this.elementsBuilder,
  backgroundPainter: backgroundPainter ?? this.backgroundPainter,
  foregroundPainter: foregroundPainter ?? this.foregroundPainter,
  foregroundPainterBuilder:
      foregroundPainterBuilder ?? this.foregroundPainterBuilder,
  foregroundWidgetBuilder:
      foregroundWidgetBuilder ?? this.foregroundWidgetBuilder,
  height: theme?.height ?? height,
  width: theme?.width ?? width,
  key: key ?? this.key,
  flagChild: theme?.flagChild ?? flagChild,
);