15 lines
401 B
Dart
15 lines
401 B
Dart
|
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;
|
||
|
}
|
||
|
}
|