readFile method Null safety

Future<File> readFile(
  1. {required String name}
)

read the pdf

Implementation

static Future<File> readFile({required String name}) async {
  /// get the root directory
  final dir = await getApplicationDocumentsDirectory();

  // create a path
  final path = dir.path + "/$name";

  /// create a file and give it the path
  final File pdfFile = File(path);

  return pdfFile;
}