analogLayout property
AnalogWatchfaceLayout?
analogLayout
Get the value of the subfield analogLayout
Implementation
AnalogWatchfaceLayout? get analogLayout {
final field = getField(WatchfaceSettingsLayoutField.ID);
final typeField = getField(WatchfaceSettingsModeField.ID);
final isSubFieldValid =
typeField != null && [1].contains(typeField.getValue());
if (field != null && field.isValid() && isSubFieldValid) {
var subField = field.getValidSubField(fields);
return field.getValue(subField: subField);
} else {
return null;
}
}
Sets the layout subfield with value
. Throws FieldNotDefinedError
if the subfield is not defined in the message.
Implementation
set analogLayout(AnalogWatchfaceLayout? value) {
final field = getField(WatchfaceSettingsLayoutField.ID);
if (field != null) {
if (value == null) {
field.clear();
} else {
var subField = field.getValidSubField(fields);
field.setValue(0, value, subField);
}
} else {
throw FieldNotDefinedError(field!.name);
}
}