switchButton method
DefineMTileModifier
switchButton({
- required RxBool value,
- ValueChanged<
bool> ? onChanged, - bool autoReverseState = true,
Implementation
DefineMTileModifier switchButton({
required RxBool value,
final ValueChanged<bool>? onChanged,
bool autoReverseState = true,
}) {
final DefineMTileModifier newModifierValue = this.copyWith(
valueWidgetRight: Obx(
() {
return CupertinoSwitch(
value: value.value,
onChanged: (v) {
if (autoReverseState) value.value = v;
if (onChanged != null) onChanged(v);
},
activeColor: Color(0xffFD211E),
trackColor: Colors.white.withOpacity(0.3),
);
},
),
);
return newModifierValue;
}