onChangingSelected method

Future<bool> onChangingSelected(
  1. BuildContext context,
  2. Asset asset,
  3. bool isSelected
)

Implementation

Future<bool> onChangingSelected(
  BuildContext context,
  Asset asset,
  bool isSelected,
) async {
  final bool? selectPredicateResult = await selectPredicate?.call(
    context,
    asset,
    isSelected,
  );
  if (selectPredicateResult == false) {
    return false;
  }
  if (isSelected) {
    unSelectAsset(asset);
  } else {
    selectAsset(asset);
  }
  return true;
}