Future<int?> get metadataLength async { try { return file .exists() .then((exists) => (exists) ? file.length() : Future.value()); } on Exception { return Future.value(); } }