navigate function

dynamic navigate(
  1. BuildContext context,
  2. int scanItem,
  3. DocumentType? type
)

IDCARD: 1, FACEVERIFY: 2, LIVELINESS: 3

Implementation

navigate(BuildContext context, int scanItem, DocumentType? type) {
  switch (scanItem) {
    case 1:
      if (type != null) {
        goTo(
            context,
            ChooseMethod(
              documentCode: type.code!,
              isBackRequired: type.isBackRequired!,
              includeListDoc: false,
              includeCountry: false,
              documentId: type.sId!,
              documentName: type.name!,
              countryId: '',
              countryName: '',
            ));
      } else {
        goTo(
            context,
            ChooseDoc(
              countryValue: passedCountry,
            ));
      }

      break;
    // case 2:
    //  break;
    case 3:
      goTo(
        context,
        const LiveFlow(),
      );
      break;
  }
}