import 'package:path_provider/path_provider.dart';
import 'dart:io';
void createAppFolder() async {
final directory = await getExternalStorageDirectory();
final dirPath = '${directory.path}/some_name' ;
await new Directory(dirPath).create();
}
this whats I tried of course I set up the permission for writing to storage but this code creates a directory on this path /storage/emulated/0/Android/data/com.example.test_app/files/some_name
and whats I need is to be created on this path /storage/emulated/0/some_name
any idea of whats im doing wrong or they are another way to do thats ??
if you want to create dir in /storage/emulated/0
try this.
import 'dart:io';
_createFolder()async{
final folderName="some_name";
final path= Directory("storage/emulated/0/$folderName");
if ((await path.exists())){
// TODO:
print("exist");
}else{
// TODO:
print("not exist");
path.create();
}
}