collectNetworkAudit static method

Future<void> collectNetworkAudit(
  1. ACLDatabase db
)

Implementation

static Future<void> collectNetworkAudit(ACLDatabase db) async {
  try {
    final networkData = await AclSdkPlatform.instance.getNetworkAudit();
    if (networkData == null) {
      print('collectNetworkAudit: batteryInfo not found');
      return;
    }

    await db.networkAuditDao.create(NetworkAuditCompanion(
      createdAt: Value(DateTime.now()),
      downloadSpeed: Value(networkData['downloadSpeed']),
      isCellular: Value(networkData['isCellular']),
      isEthernet: Value(networkData['isEthernet']),
      isWifi: Value(networkData['isWifi']),
      totalDownload: Value(networkData['totalDownload']),
      totalUpload: Value(networkData['totalUpload']),
      uploadSpeed: Value(networkData['uploadSpeed']),
      wifiSsid: Value(networkData['wifiSsid']),
    ));
  } catch (e) {
    print('Error: NetworkAuditHelper.collectNetworkAudit');
    print(e);
  }
}