[Flutter] Get some special directories path



I'm sure, if you are a Flutter's developer, that you will need one day to get specific paths, for instance to store files, generate temporary files etc...

Path_provider package

For that I use the 'path_provider' package that has some helpers methods. For example:

Future<Directory> getApplicationDocumentsDirectory()

returns the documents directory.


How to use it ?

Directory tempDir = await getTemporaryDirectory();
String tempPath = tempDir.path;

Directory appDocDir = await getApplicationDocumentsDirectory();
String appDocPath = appDocDir.path;


Follow the links:

Package: https://pub.dev/packages/path_provider

Package's documentation: https://pub.dev/documentation/path_provider/latest/index.html





Comments

Popular posts from this blog

EMGU with Xamarin Forms guide [part 1]

[Xamarin Forms] Custom bottom bordered entry (iOS & Android)

Set your browser on Fire with P5.js