initInternal method

Future<void> initInternal()

Internal Initialization routines.

Implementation

Future<void> initInternal() async {
  //
  _connectivitySubscription ??=
      _connectivity.onConnectivityChanged.listen((ConnectivityResult result) {
    for (final listener in _listeners) {
      listener.onConnectivityChanged(result);
    }
  });

  await _initConnectivity().then((String status) {
    _connectivityStatus = status;
    _wasOffline = status.contains('none');
  }).catchError((e) {
    _connectivityStatus = 'none';
  });

  // If running on the web the rest of the code is incompatible.
  if (kIsWeb) {
    return;
  }

  // Get the installation number
  _installNum ??= await InstallFile.id();

  // Determine the location to the files directory.
  _path ??= await Files.localPath;
}