asyncRemoveWhen method

Future<void> asyncRemoveWhen(
  1. Future<bool> test(
    1. dynamic item
    )
)

Implementation

Future<void> asyncRemoveWhen(Future<bool> Function(dynamic item) test )async{
  int storedItems = length;
  for(int i = 0; i < storedItems; i++){
    if(await test(this[i])){
      removeAt(i);
      i--;
      storedItems--;
    }else{
      //Do nothing
    }
  }
}