signedOut static method
Sends what can be sent, then empties every store: signing out.
A device holds only what its session may read, so nothing the session wrote may stay behind it. What could not be sent is discarded with it, which is the same trade a shared kiosk makes; the attempt comes first so a person signing out on a working connection loses nothing.
Implementation
static Future<void> signedOut() async {
_retry?.cancel();
_retry = null;
if (_send != null && _canReach()) {
_kick();
await idle.timeout(const Duration(seconds: 10), onTimeout: () {});
}
for (final String model in _builders.keys) {
await (await store(model)).clear();
}
}