getOutputPath method

Future<String> getOutputPath({
  1. required String filePath,
  2. required FileFormat format,
})

Returns the output path of the exported file

Implementation

Future<String> getOutputPath({
  required String filePath,
  required FileFormat format,
}) async {
  final String tempPath =
      outputDirectory ?? (await getTemporaryDirectory()).path;
  final String n = name ?? path.basenameWithoutExtension(filePath);
  final int epoch = DateTime.now().millisecondsSinceEpoch;
  return "$tempPath/${n}_$epoch.${format.extension}";
}