boolean<C extends Component> static method
A boolean property.
Implementation
static ComponentField<C> boolean<C extends Component>(
String name, {
required bool defaultValue,
bool Function(C component)? get,
void Function(C component, bool value)? set,
String? doc,
String? group,
List<String> formerNames = const [],
bool transient = false,
}) => ComponentField(
ComponentPropertyDef(
name,
ComponentPropertyKind.boolean,
defaultValue: BoolValue(defaultValue),
doc: doc,
group: group,
formerNames: formerNames,
transient: transient,
),
read: get == null ? null : (c, _) => BoolValue(get(c)),
write: set == null
? null
: (c, v, _) {
if (v is BoolValue) set(c, v.value);
},
);