1
0
mirror of https://github.com/immich-app/immich.git synced 2024-12-26 10:50:29 +02:00
immich/mobile/lib/shared/services/device_info.service.dart
xpwmaosldk d02b97e1c1
Add service provider (#250)
* optimize android side gradle settings

* android minsdk back to 21

* remove unused package, update linter and fix lint error

* clean code of 'shared module' with offical dart style guide

* restore uploadProfileImage method in UserService

* add service provider

* fix searchFocusNode init error
2022-06-25 13:46:51 -05:00

23 lines
585 B
Dart

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