flow function

dynamic flow(
  1. BuildContext context
)

Implementation

flow(BuildContext context) {
 // print('steps=${steps.length}');
  if (steps.isEmpty) {
    return;
  }
  //print('current=${current}');
  if (current == null) {
    current = steps.first;
    navigate(context, current!.scanItem!, current!.documentType);
  } else {
    int nextIndex = steps.indexOf(current!) + 1;
   // if (nextIndex < 2) {
   if (nextIndex < steps.length) {
      if (steps[nextIndex].scanItem == 2) {
      //  print('steps[nextIndex].scanItem=${steps[nextIndex].scanItem}');
        faceMatch = true;
        current = steps[nextIndex];
        flow(context);
      } else {
      //  print('nextInde$nextIndex');
        current = steps[nextIndex];
        navigate(context, current!.scanItem!, current!.documentType);
      }
    } else {
      if (faceMatch) {
       // submitFace(context);
        goTo(context, const FaceVerifyLoading());
      }else{
        //submitKyc(context);
        goTo(context, const SubmitScanLoading());
      }

    }
  }
}