refreshPathProperties method

Future<void> refreshPathProperties({
  1. bool maxDateTimeToNow = true,
})

Call this method to update the property

Implementation

Future<void> refreshPathProperties({
  bool maxDateTimeToNow = true,
}) async {
  if (maxDateTimeToNow) {
    filterOption = filterOption.copyWith(
      createTimeCond: filterOption.createTimeCond.copyWith(
        max: DateTime.now(),
      ),
      updateTimeCond: filterOption.updateTimeCond.copyWith(
        max: DateTime.now(),
      ),
    );
  }

  final result = await PhotoManager.fetchPathProperties(
    entity: this,
    filterOptionGroup: filterOption,
  );
  if (result != null) {
    this.assetCount = result.assetCount;
    this.name = result.name;
    this.isAll = result.isAll;
    this.type = result.type;
    this.filterOption = filterOption;
    this.lastModified = result.lastModified;
  }
}