1
0
Fork 0
mirror of https://github.com/immich-app/immich.git synced 2025-01-08 12:56:48 +01:00
immich/mobile/lib/shared/services/device_info.service.dart

20 lines
575 B
Dart

import 'package:device_info_plus/device_info_plus.dart';
import 'package:flutter_udid/flutter_udid.dart';
import 'dart:io' show Platform;
class DeviceInfoService {
Future<Map<String, dynamic>> getDeviceInfo() async {
// Get device info
DeviceInfoPlugin deviceInfo = DeviceInfoPlugin();
String deviceId = await FlutterUdid.consistentUdid;
String deviceType = "";
if (Platform.isAndroid) {
deviceType = "ANDROID";
} else if (Platform.isIOS) {
deviceType = "IOS";
}
return {"deviceId": deviceId, "deviceType": deviceType};
}
}