Open emersion opened 1 year ago
enum ConnectivityResult { bluetooth, wifi, ethernet, mobile, none, vpn }
vs.
typedef enum {
G_NETWORK_CONNECTIVITY_LOCAL = 1,
G_NETWORK_CONNECTIVITY_LIMITED = 2,
G_NETWORK_CONNECTIVITY_PORTAL = 3,
G_NETWORK_CONNECTIVITY_FULL = 4
} GNetworkConnectivity;
I'm on flatpak too. connectivity_plus doesn't work. What is the work around?
Thanks!! I didn't know this existed.
For anyone else that needs this:
import 'package:xdg_desktop_portal/xdg_desktop_portal.dart';
final XdgDesktopPortalClient portal = XdgDesktopPortalClient();
portal.networkMonitor.status.listen((event) {
_hasNetwork = event.available;
});
Plugin
connectivity_plus
Use case
I want to distribute my app in a Flatpak sandbox.
The plugin is not allowed to connect to the D-Bus system bus:
Proposal
Flatpak portals are a network daemon agnostic way to fetch network information. It works both inside and outside sandboxes.
https://docs.flatpak.org/en/latest/portal-api-reference.html#gdbus-org.freedesktop.portal.NetworkMonitor
It shjould be used instead of trying to talk directly to NetworkManager.