mirror of
https://github.com/immich-app/immich.git
synced 2024-12-26 10:50:29 +02:00
d02b97e1c1
* 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
23 lines
585 B
Dart
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};
|
|
}
|
|
}
|