indexIncrement method

dynamic indexIncrement({
  1. String? route,
  2. bool isDefault = false,
})

Implementation

indexIncrement({String? route, bool isDefault = false}) {
  dog.i("Incremetn =====> $route");
  if (screenWiseModel != null) {
    int arrayLength = screenWiseModel!.localClick!.length - 1;
    if (route != null) {
      dog.i("Route Not Null ======> $route");
      if (routeIndex[route] == null) {
        dog.i("Route INit ======>");
        if ((arrayLength + 1) == 1) {
          routeIndex[route] = 0;
        } else {
          routeIndex[route] = 1;
        }
      } else {
        if (routeIndex[route] != arrayLength &&
            routeIndex[route] < arrayLength) {
          dog.i("Route Increment ======>");
          routeIndex[route]++;
        } else {
          dog.i("Route Reset ======>");
          routeIndex[route] = 0;
        }
      }
    } else {
      if (currentAdIndex < arrayLength && currentAdIndex != arrayLength) {
        currentAdIndex++;
      } else {
        currentAdIndex = 0;
      }
    }
  }
  if (onJobComplete != null) {
    onJobComplete!();
  }
}