checkCanEvaluate method

Future<bool> checkCanEvaluate()

Implementation

Future<bool> checkCanEvaluate() async {
  List<dynamic>? sensies = await getDataFromAsyncStorage(SENSIES);
  int flow = 0, block = 0;
  if (sensies == null) {
    canEvaluate = false;
    return false;
  }
  for (int i = 0; i < sensies.length; i++) {
    if (sensies[i]['flow'] == 1) {
      flow++;
    } else {
      block++;
    }
  }
  if (flow >= 3 && block >= 3) {
    canEvaluate = true;
    return true;
  }
  canEvaluate = false;
  return false;
}