blob: 3c7d057ec133b154817b2beeef86af9e827210ba [file] [log] [blame] [view]
# state property
[InterfaceState](../../package-fidl_fidl/InterfaceState-class.md) state
_inherited_
<p>Gets the current state.</p>
## Implementation
```dart
InterfaceState get state => _currentState;
```
state=
([InterfaceState](../../package-fidl_fidl/InterfaceState-class.md) newState)
_inherited_
<p>Change the state.</p>
## Implementation
```dart
@protected
set state(InterfaceState newState) {
if (_currentState == newState) {
// No change.
return;
}
if (newState.index < _currentState.index) {
throw FidlStateException(
"Can't change InterfaceState from $_currentState to $newState.");
}
_currentState = newState;
_streamController.add(newState);
}
```