buildMaterial method

  1. @override
Widget buildMaterial(
  1. BuildContext context
)
override

Implementation

@override
Widget buildMaterial(BuildContext context) => Switch(
  key: materialSwitchData?.widgetKey ?? platformSwitchData!.widgetKey,
  value: materialSwitchData?.value ?? platformSwitchData!.value!,
  onChanged: !(materialSwitchData?.isEnabled ?? platformSwitchData!.isEnabled)
      ? null
      : materialSwitchData?.onChanged ?? platformSwitchData!.onChanged,
  activeThumbColor: materialSwitchData?.activeThumbColor ?? platformSwitchData?.activeThumbColor,
  activeTrackColor: materialSwitchData?.activeTrackColor ?? platformSwitchData?.activeTrackColor,
  inactiveThumbColor:
      materialSwitchData?.inactiveThumbColor ?? platformSwitchData?.inactiveThumbColor,
  inactiveTrackColor:
      materialSwitchData?.inactiveTrackColor ?? platformSwitchData?.inactiveTrackColor,
  activeThumbImage: materialSwitchData?.activeThumbImage ?? platformSwitchData?.activeThumbImage,
  onActiveThumbImageError:
      materialSwitchData?.onActiveThumbImageError ?? platformSwitchData?.onActiveThumbImageError,
  inactiveThumbImage:
      materialSwitchData?.inactiveThumbImage ?? platformSwitchData?.inactiveThumbImage,
  onInactiveThumbImageError:
      materialSwitchData?.onInactiveThumbImageError ??
      platformSwitchData?.onInactiveThumbImageError,
  thumbColor: materialSwitchData?.thumbColor,
  trackColor: materialSwitchData?.trackColor,
  trackOutlineColor:
      materialSwitchData?.trackOutlineColor ?? platformSwitchData?.trackOutlineColor,
  trackOutlineWidth:
      materialSwitchData?.trackOutlineWidth ?? platformSwitchData?.trackOutlineWidth,
  thumbIcon: materialSwitchData?.thumbIcon ?? platformSwitchData?.thumbIcon,
  materialTapTargetSize: materialSwitchData?.materialTapTargetSize,
  dragStartBehavior:
      materialSwitchData?.dragStartBehavior ??
      platformSwitchData?.dragStartBehavior ??
      PlatformSwitchData.kDefaultDragStartBehavior,
  mouseCursor: (materialSwitchData?.mouseCursor ?? platformSwitchData?.mouseCursor)?.resolve({
    .selected,
    .hovered,
    .focused,
    .disabled,
  }),
  focusColor: materialSwitchData?.focusColor ?? platformSwitchData?.focusColor,
  hoverColor: materialSwitchData?.hoverColor,
  overlayColor: materialSwitchData?.overlayColor,
  splashRadius: materialSwitchData?.splashRadius,
  focusNode: materialSwitchData?.focusNode ?? platformSwitchData?.focusNode,
  onFocusChange: materialSwitchData?.onFocusChange ?? platformSwitchData?.onFocusChange,
  autofocus:
      materialSwitchData?.autofocus ??
      platformSwitchData?.autofocus ??
      PlatformSwitchData.kDefaultAutofocus,
  padding: materialSwitchData?.padding,
);