1
I have a method to check certain files. pdf exist in the app folder, I used path_provider to get the path, how do I check if the file exists in the directory?
Future<void> checkFile() async{
      try {
        var dir = await getApplicationDocumentsDirectory();
        path = "${dir.path}/${document["title"]}.pdf";
        if(path != null){ // Preciso checar aqui se o arquivo com exatamente este nome existe no diretório.
          setState(() {
            progressString = "Livro Baixado!";
          });
        }
      } catch (e) {
        setState(() {
          progressString = "Falha em checar se o livro já foi baixado!";
        });
        print(e);
      }
    }