initInternal method

Future<void> initInternal()

Internal Initialization routines.

Implementation

Future<void> initInternal() async {
  //
  // if (inFlutterTest) {
  if (!inWidgetsFlutterBinding) {
    // Such functionality is not available during testing
    return;
  }

  _connectivitySubscriptionList ??=
      _connectivity.onConnectivityChanged.listen((connects) {
    connects.map((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.
  _appDirPath ??= await Files.localPath;
}