getExistScoreNodes function

Future getExistScoreNodes(
  1. dynamic type,
  2. dynamic path
)

Implementation

Future getExistScoreNodes(var type, var path) async {
  var uuid = '';
  type == Types.users ? uuid = Storage.userUUID : uuid = Storage.deviceUUID;

  try {
    var strPath =
        ':$type:' + uuid + ':' + Storage.geigerIndicatorUUID + ':data:$path';
    await Storage.controller!.get(strPath);

  } catch (e) {
  //Creation
  // ignore: avoid_print
  print('\n');
  // ignore: avoid_print
  print('$type,$path is not found');

  if (path == Types.geigerScoreUser ||
  path == Types.geigerScoreDevice ||
  path == Types.geigerScoreAggregate) {
  // ignore: avoid_print
  print(path);
  await createScoreNode(type, path); //initailzation
  } else if (path == Types.geigerScoreMSE) {
   //await createScoreMSENode(type, path);
  } else if (path == Types.recommendations) {
  await createRecommendationNode(type);
  }
  }
}