askForSavePath static method
- String saveName
Renvoie un chemin complet où sauvegarder le fichier avec le nom donné.
Affiche l'emplacement choisi dans la console.
saveName
: Le nom du fichier à sauvegarder.
Retourne un Future<String>
avec le chemin complet.
Implementation
static Future<String> askForSavePath(String saveName) async {
/*final result = await FilePicker.platform.saveFile(
type: FileType.custom,
allowedExtensions: ["mbsave"]
);*/
/*String result = await getSaveName();
if (result == null){
throw Exception("No path was specified");
}
String path = result;*/
print("Fichier sauvegardé dans ${((await pp.getApplicationDocumentsDirectory()).path)}/$saveName");
return "${(await pp.getApplicationDocumentsDirectory()).path}/$saveName";
}