autosos_flutter/lib/util/device_id_utils.dart

15 lines
401 B
Dart
Raw Normal View History

2024-03-09 14:28:23 +08:00
import 'package:autosos_flutter/util/sp_util.dart';
import 'package:basic_utils/basic_utils.dart';
import 'package:uuid/uuid.dart';
class DeviceIdUtils{
static String? getDeviceId(){
SPUtil spUtil = SPUtil();
var deviceId = spUtil.get<String>("JJdeviceId");
if(StringUtils.isNullOrEmpty(deviceId)){
var uuid = const Uuid();
return uuid.v1();
}
return deviceId;
}
}