gatherInformation method

Future<void> gatherInformation()

Implementation

Future<void> gatherInformation() async {
  // DEVICE INFO
  try {
    final deviceInfo = await _deviceInfoService.gatherDeviceInfo();
    await Prefs.setString(devicePropertiesKey, jsonEncode(deviceInfo));
  } catch (e, st) {
    dbLogger.severe('Error gathering device info', e, st);
  }

  // GEO INFO
  try {
    final geoInfo = await _geoInfoService.fetchGeoInfo(Uri.parse('https://ipinfo.io/json'));
    await _lock.synchronized(() {
      _geoInfoProperties.clear();
      _geoInfoProperties.addAll(geoInfo);
    });
  } catch (e, st) {
    dbLogger.severe('Error gathering geo info', e, st);
  }

  // APP INFO
  try {
    final appInfo = await _appInfoService.gatherAppInfo();
    await Prefs.setString(appPropertiesKey, jsonEncode(appInfo));
  } catch (e, st) {
    dbLogger.severe('Error gathering app info', e, st);
  }
}