onDeviceChange property
Returns a Stream of the DeviceDetails changes.
Implementation
Stream<List<DeviceDetails>> get onDeviceChange {
if (_devicesController == null) {
_devicesController = StreamController.broadcast();
Future(() async {
(await _mediaManager)?.onDeviceChange(() async {
_devicesController?.add(await enumerateDevices());
});
});
}
return _devicesController!.stream;
}