| |
| |
| |
| # byteDataProperty method |
| |
| |
| |
| |
| *[<Null safety>](https://dart.dev/null-safety)* |
| |
| |
| |
| |
| [ByteDataProperty](../../package-fuchsia_inspect_inspect/ByteDataProperty-class.md)? byteDataProperty |
| (String name) |
| |
| |
| |
| |
| |
| <p>Returns a <a href="../../package-fuchsia_inspect_inspect/ByteDataProperty-class.md">ByteDataProperty</a> with <code>name</code> on this node.</p> |
| <p>If a <a href="../../package-fuchsia_inspect_inspect/ByteDataProperty-class.md">ByteDataProperty</a> with <code>name</code> already exists and is not deleted, |
| this method returns it.</p> |
| <p>Otherwise, it creates a new property initialized to the empty |
| byte data container.</p> |
| <p>Throws <a href="../../package-fuchsia_inspect_inspect/InspectStateError-class.md">InspectStateError</a> if a non-deleted property with <code>name</code> already exists |
| but it is not a <a href="../../package-fuchsia_inspect_inspect/ByteDataProperty-class.md">ByteDataProperty</a>.</p> |
| |
| |
| |
| ## Implementation |
| |
| ```dart |
| ByteDataProperty? byteDataProperty(String name) { |
| if (_writer == null) { |
| return ByteDataProperty.deleted(); |
| } |
| if (_properties.containsKey(name)) { |
| if (_properties[name] is! ByteDataProperty) { |
| throw InspectStateError("Can't create ByteDataProperty named $name;" |
| ' a different type exists.'); |
| } |
| return _properties[name] as ByteDataProperty?; |
| } |
| return _properties[name] = ByteDataProperty._(name, this, _writer!); |
| } |
| ``` |
| |
| |
| |
| |
| |
| |
| |