merge static method

Widget merge({
  1. Key? key,
  2. Curve? curve,
  3. Duration? duration,
  4. ControlAffinity? controlAffinity,
  5. SwitchStyle? switchStyle,
  6. ButtonStyle? buttonStyle,
  7. SwitchTileThemeData? data,
  8. required Widget child,
})

Creates an SwitchTileTheme that controls the style of descendant widgets, and merges in the current SwitchTileTheme, if any.

The child arguments must not be null.

Implementation

static Widget merge({
  Key? key,
  Curve? curve,
  Duration? duration,
  ControlAffinity? controlAffinity,
  SwitchStyle? switchStyle,
  ButtonStyle? buttonStyle,
  SwitchTileThemeData? data,
  required Widget child,
}) {
  return Builder(
    builder: (BuildContext context) {
      final parent = SwitchTileTheme.of(context);
      return SwitchTileTheme(
        key: key,
        data: parent.merge(data).copyWith(
              curve: curve,
              duration: duration,
              controlAffinity: controlAffinity,
              switchStyle: switchStyle,
              buttonStyle: buttonStyle,
            ),
        child: child,
      );
    },
  );
}