onContinue method

dynamic onContinue(
  1. BuildContext context
)

Implementation

onContinue(BuildContext context) {
  _channel.checkPermission().then((authorized) => {
        if (authorized)
          {
            _channel
                .openDocumentscopy(
                  appKey: globals.appKey,
                  ticket: globals.ticket,
                  themeBuilder: globals.themeBuilder,
                  baseUrl: "",
                  environment: globals.environment,
                  showFeedback: globals.showFeedback,
                )
                .then((result) async => {
                      await DocumentsCopyResult(result: result)
                          .onDocSuccess(),
                      onSuccess!(globals.onDocSuccess ?? result)
                    })
                .onError((error, stackTrace) async => {
                      await DocumentsCopyResult(error: error).onDocError(),
                      onError!(globals.onDocError ?? error)
                    })
                .catchError((error) async => {
                      await DocumentsCopyResult(error: error).onDocError(),
                      onError!(globals.onDocError ?? error)
                    })
                .whenComplete(() => Navigator.pop(context))
          }
        else
          {
            Navigator.push(
              context,
              MaterialPageRoute(
                builder: (context) => verifyPermissionScreen(),
              ),
            )
          }
      });
}