build method
CupertinoSwitch
build({
- required BuildContext context,
- required FormMapper mapper,
- required TypeProperty property,
- required Keywords args,
override
build and bind the corresponding widget
context
a FormMapper
mapper
the FormMapper
property
a TypeProperty
args
and parameters that will be handled by the adapter
Implementation
@override
CupertinoSwitch build({required BuildContext context, required FormMapper mapper, required TypeProperty property, required Keywords args}) {
CupertinoSwitch widget = CupertinoSwitch(
value: mapper.getValue(property),
onChanged: (bool newValue) {
mapper.notifyChange(property: property, value: newValue);
},
);
mapper.map(property: property, widget: widget, adapter: this);
return widget;
}