copyWith static method

Widget copyWith({
  1. Key? key,
  2. required Widget child,
  3. BoxConstraints? constraints,
  4. EdgeInsets? menuPadding,
  5. double? menuSpacing,
  6. EdgeInsets? titlePadding,
  7. EdgeInsets? bodyPadding,
  8. Color? background,
  9. Color? barrierColor,
  10. TextStyle? titleTextStyle,
  11. TextAlign? bodyTextAlign,
  12. ImageFilter? imageFilter,
})

Makes a copy of the nearest DialogTheme overwriting selected fields.

Implementation

static Widget copyWith({
  Key? key,
  required Widget child,
  BoxConstraints? constraints,
  EdgeInsets? menuPadding,
  double? menuSpacing,
  EdgeInsets? titlePadding,
  EdgeInsets? bodyPadding,
  Color? background,
  Color? barrierColor,
  TextStyle? titleTextStyle,
  TextAlign? bodyTextAlign,
  ImageFilter? imageFilter,
}) {
  return Builder(
    key: key,
    builder: (context) => DialogTheme(
      data: DialogTheme.of(context).copyWith(
        constraints: constraints,
        menuPadding: menuPadding,
        menuSpacing: menuSpacing,
        titlePadding: titlePadding,
        bodyPadding: bodyPadding,
        background: background,
        barrierColor: barrierColor,
        titleTextStyle: titleTextStyle,
        bodyTextAlign: bodyTextAlign,
        imageFilter: imageFilter,
      ),
      child: child,
    ),
  );
}