getPreviousDirectory method

Future<String> getPreviousDirectory()

Implementation

Future<String> getPreviousDirectory() async {
  String _tempDirectory = pathDirectory;
  if (_tempDirectory != "/storage/emulated/0/") {
    int _length = _tempDirectory
        .split("/")[_tempDirectory.split("/").length - 2]
        .length;
    String _finalPath =
        _tempDirectory.substring(0, _tempDirectory.length - _length - 1);
    print(_finalPath);
    return _finalPath;
  } else {
    String _finalPath = "/storage/emulated/0/";
    return _finalPath;
  }
}