checkRow static method
Implementation
static Row checkRow(ZugClient client, String caption, String prop, bool defaultValue, Function onChange, {Function? onTrue, Function? onFalse}) {
return Row(
mainAxisAlignment: MainAxisAlignment.center,
children: [
Text("$caption:"),
Checkbox(
value: client.prefs?.getBool(prop) ?? defaultValue,
onChanged: (b) {
client.prefs?.setBool(prop, b ?? defaultValue).then((value) {
ZugClient.log.info("Setting $caption: $b");
onChange();
});
if ((b ?? false)) {
if (onTrue != null) onTrue();
} else {
if (onFalse != null) { //ZugClient.log.info(onFalse.toString());
onFalse();
}
}
}),
],
);
}