getApplicationDocumentsDirectory function

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.

On iOS, this uses the NSDocumentsDirectory API.

On Android, this returns the AppData directory.


Future<Directory> getApplicationDocumentsDirectory() async {
  final String path =
      await _channel.invokeMethod('getApplicationDocumentsDirectory');
  if (path == null) {
    return null;
  return new Directory(path);