The browser's navigator.onLine.
navigator.onLine
bool? platformOnlineState() => web.window.navigator.onLine;