title: How to open PDF file from internal storage in flutter
body: <p>Used Plugin for the code</p>
  <pre><code>native_pdf_view: ^4.0.1
  </code></pre>
  <p>Sample code where is am getting error, I am able to use pdf file from assets but not able to load pdf from local storage</p>
  <pre><code>    return Container(
        child: PdfView(
          controller:
              // sample,
              PdfController(
            document: PdfDocument.openFile(widget.path),
          ),
          onDocumentLoaded: (document) {
            setState(() {
              isLoaded = true;
            });
          },
          pageLoader: Center(child: CircularProgressIndicator()),
        ),
      );
  </code></pre>
  <p>error, it says the file was not found but this file path was extracted from the existing file</p>
  <pre><code>D/PDF_RENDER(  585): OpenFileDocument. File: /storage/emulated/0/Doc_Holder/c4611_sample_explain.pdf
  D/PDF_RENDER(  585): OpenAssetDocument. Created file: /data/user/0/com.example.doc_holder/cache/992d7c88890d40268ae7ac4103bf96ba.pdf
  D/PDF_RENDER(  585): OpenFileDocument. File: /data/user/0/com.example.doc_holder/cache/992d7c88890d40268ae7ac4103bf96ba.pdf
  D/PDF_RENDER(  585): OpenFileDocument. File: /storage/emulated/0/Doc_Holder/c4611_sample_explain.pdf
  
  ════════ Exception caught by widgets library ═══════════════════════════════════
  The following _CastError was thrown building PdfView(dirty, state: _PdfViewState#6990d):
  Null check operator used on a null value
  
  The relevant error-causing widget was
  PdfView
  lib/const/pdf.dart:23
  When the exception was thrown, this was the stack
  #0      _PdfViewState._buildLoaded
  package:native_pdf_view/src/native_pdf_view.dart:172
  #1      _PdfViewState.build
  package:native_pdf_view/src/native_pdf_view.dart:205
  #2      StatefulElement.build
  package:flutter/…/widgets/framework.dart:4683
  #3      ComponentElement.performRebuild
  package:flutter/…/widgets/framework.dart:4566
  #4      StatefulElement.performRebuild
  package:flutter/…/widgets/framework.dart:4738
  ...
  </code></pre>