getUuid method

  1. @override
String getUuid()
override

Implementation

@override
String getUuid() {
  final cookie = document.cookie;
  try {
    final entity = cookie?.split(';').map((item) {
      final split = item.split("=");
      return MapEntry(split[0], split[1]);
    });
    final cookieMap = Map.fromEntries(entity!);
    if (cookieMap.containsKey(_uuidKey)) {
      Log('Cookie').i('uuid : ${cookieMap[_uuidKey]}');
      return cookieMap[_uuidKey]!;
    }
  }catch(e){
    Log('Cookie').i('Error : $e');
  }

  return _generateUuid();
}