cacheDeviceInfo function

Future<void> cacheDeviceInfo()

Pre-cache device info (call during init)

Implementation

Future<void> cacheDeviceInfo() async {
  try {
    final deviceInfo = DeviceInfoPlugin();

    if (Platform.isIOS) {
      final iosInfo = await deviceInfo.iosInfo;
      _cachedDeviceType = iosInfo.utsname.machine;
    } else if (Platform.isAndroid) {
      final androidInfo = await deviceInfo.androidInfo;
      _cachedDeviceType = androidInfo.model;
    }
  } catch (e) {
    // Ignore
  }
}