settingSwitch function
Implementation
Widget settingSwitch(item, Function setState, String parent, String setting) {
final name = setting.uppercaseFirst();
return Padding(
padding: const EdgeInsets.all(8.0),
child: Row(
children: [
ToggleSwitch(
checked: prefs.getBool('$item-$setting') ?? false,
onChanged: (value) {
prefs.setBool('$item-$setting', value);
setState(() {});
// Execute command in WSL
WSLApi().setSetting(item, parent, setting, value.toString());
},
),
const SizedBox(
width: 8.0,
),
Text(name),
],
),
);
}