getWidget method
Returns the Flutter widget used to display and edit this property.
The default implementation renders a Text with the current value of the property on the first owner, or an empty string when:
- no owners are present,
- the property is not found, or
- values differ across multiple owners (mixed-value state).
Subclasses should override this to return an interactive editor widget.
Implementation
Widget getWidget(BuildContext context) {
String value = '';
if (owners.isNotEmpty) {
var owner = owners[0];
var property = owner.getProperty(propertyName);
if (property != null) {
value = property.getValue(owner).toString();
}
for (int a = 1; a < owners.length; a++) {
var owner = owners[a];
var property = owner.getProperty(propertyName);
if (property == null) {
value = '';
} else if (property.getValue(owner) != value) {
value = '';
}
}
}
return Text(key: key, value);
}