routeCalculate static method

void routeCalculate({
  1. required List<LatLng> wayPoints,
  2. int? strategy,
  3. CalculateCallBack? calculateBack,
})

Implementation

static void routeCalculate({required List<LatLng> wayPoints, int? strategy, CalculateCallBack? calculateBack}) {
  XbrSearch.routeSearchPage(
    wayPoints: wayPoints,
    strategy: strategy ?? DrivingStrategy.DEFAULT,
    showFields: ShowFields.COST,
    back: (code, data) {
      if (code != 1000) return;
      if(data.paths==null|| data.paths!.isEmpty) return;
      if(calculateBack != null){
        calculateBack(data.paths![0].distance?.toInt()??0,data.paths![0].duration?.toInt()??0);
      }
    },
  );
}