Future<Directory> getApplicationDocumentsDirectory()

Path to a directory where the application may place files that are private to the application and will only be cleared when the application itself is deleted.

Examples:

  • iOS: NSDocumentsDirectory
  • Android: The AppData directory.

Source

static Future<Directory> getApplicationDocumentsDirectory() async {
  Map<String, dynamic> result = await PlatformMessages.invokeMethod(
      _kChannelName, 'PathProvider.getApplicationDocumentsDirectory');
  if (result == null)
    return null;
  return new Directory(result['path']);
}