ente/mobile/lib/utils/ram_check_util.dart
2024-10-24 19:02:13 +05:30

14 lines
426 B
Dart

import "package:system_info_plus/system_info_plus.dart";
/// The total amount of RAM in the device in MB
int? deviceTotalRAM;
bool get enoughRamForLocalIndexing =>
deviceTotalRAM == null || deviceTotalRAM! >= 5 * 1024;
/// Return the total amount of RAM in the device in MB
Future<int?> checkDeviceTotalRAM() async {
deviceTotalRAM ??= await SystemInfoPlus.physicalMemory; // returns in MB
return deviceTotalRAM;
}