createFilePathAndName method

  1. @override
Future<(String, String)> createFilePathAndName({
  1. String? name,
  2. required String extension,
  3. bool temporary = false,
})
override

Implementation

@override
Future<(String, String)> createFilePathAndName(
    {String? name, required String extension, bool temporary = false}) async {
  final n = name ?? const Uuid().v1();
  final directoryPath = temporary
      ? (await getTemporaryDirectory()).path
      : await getAppDocumentsDirectoryPath();

  return ('$directoryPath/$n${n.contains('.') ? '' : '.$extension'}', n);
}