buildRecordingSwitch function
Widget
buildRecordingSwitch(
- Switch switchWidget,
- dynamic widget
)
Implementation
Widget buildRecordingSwitch(Switch switchWidget, widget) {
return Switch(
key: switchWidget.key,
value: switchWidget.value,
onChanged: (value) async {
debugPrint(
'[SelfTest] Recording switch change for "${widget.id}": $value',
);
await SelfTestManager().recordTap(widget.id);
if (switchWidget.onChanged != null) {
switchWidget.onChanged!(value);
} else {
widget.onTap?.call();
}
},
activeThumbColor: switchWidget.activeThumbColor,
activeTrackColor: switchWidget.activeTrackColor,
inactiveThumbColor: switchWidget.inactiveThumbColor,
inactiveTrackColor: switchWidget.inactiveTrackColor,
activeThumbImage: switchWidget.activeThumbImage,
onActiveThumbImageError: switchWidget.onActiveThumbImageError,
inactiveThumbImage: switchWidget.inactiveThumbImage,
onInactiveThumbImageError: switchWidget.onInactiveThumbImageError,
thumbColor: switchWidget.thumbColor,
trackColor: switchWidget.trackColor,
thumbIcon: switchWidget.thumbIcon,
materialTapTargetSize: switchWidget.materialTapTargetSize,
dragStartBehavior: switchWidget.dragStartBehavior,
mouseCursor: switchWidget.mouseCursor,
focusColor: switchWidget.focusColor,
hoverColor: switchWidget.hoverColor,
overlayColor: switchWidget.overlayColor,
splashRadius: switchWidget.splashRadius,
focusNode: switchWidget.focusNode,
onFocusChange: switchWidget.onFocusChange,
autofocus: switchWidget.autofocus,
);
}