loadStorage method

Future<ParseXFile> loadStorage()

Implementation

Future<ParseXFile> loadStorage() async {
  // Web not need load storage.
  if (parseIsWeb) {
    return this;
  }

  final XFile possibleFile = XFile('${ParseCoreData().fileDirectory}/$name');
  // ignore: avoid_slow_async_io
  final bool exists = await File(possibleFile.path).exists();

  if (exists) {
    file = possibleFile;
  } else {
    file = null;
  }

  return this;
}