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