blob: 6f593d00671a2591ca07f53d3585a6ef98e9eeb8 [file] [log] [blame] [view]
# state property
[InterfaceState](../../package-fidl_fidl/InterfaceState.md) state
_<span class="feature">inherited</span>_
<p>Gets the current state.</p>
## Implementation
```dart
InterfaceState get state => _currentState;
```
state=
([InterfaceState](../../package-fidl_fidl/InterfaceState.md) newState)
_<span class="feature">inherited</span>_
<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);
}
```