getPathFolderWindows function Null safety

Future<String> getPathFolderWindows(
  1. {required String folder}
)

for Windows pass the name in the paramfolder

Implementation

Future<String> getPathFolderWindows({required String folder}) async {
  final PathProviderWindows provider = PathProviderWindows();
  final path = await provider.getApplicationDocumentsPath();

  var str = '$path/$folder';

  final Directory _appDocDirFolder = Directory(str);
  if (await _appDocDirFolder.exists()) {
    return _appDocDirFolder.path;
  }
  final Directory _appDocDirNewFolder =
      await _appDocDirFolder.create(recursive: true);
  return _appDocDirNewFolder.path;
}