mySwitch method
Implementation
Widget mySwitch(String label, bool switchValue, void Function() onRefresh) {
return Semantics(
label: label,
child: Switch(
value: switchValue,
onChanged: (value) {
switchValue=value;
onRefresh();
},
activeTrackColor: Colors.green,
inactiveTrackColor: Colors.red,
activeThumbColor: Colors.green,
inactiveThumbColor: Colors.red,
),
);
}