generatePath method

Future<String> generatePath(
  1. String docName
)

Implementation

Future<String> generatePath(String docName) async {
  var frontPath = (await getApplicationDocumentsDirectory()).path;

  var newPath = "$frontPath/$docName";
  var isAvailable = await Directory(newPath).exists();
  if (!isAvailable) await Directory(newPath).create(recursive: true);

  return "$newPath/";
}