dispose method
Says DeviceLossReason.destroyed on lost the first time, as every backend owes for its own dispose, and closes lost and errors.
Implementation
@override
void dispose() {
if (!_isDisposed) {
_isLost = true;
_lost.add(
const DeviceLoss(
reason: DeviceLossReason.destroyed,
message: 'the fake device was disposed',
),
);
}
_isDisposed = true;
_live.clear();
unawaited(_lost.close());
unawaited(_errors.close());
}