remove method

Future<bool> remove(
  1. dynamic object
)

Delete the first instance of an object

Implementation

Future<bool> remove(dynamic object) async {
  List<dynamic> objects = await getAll();
  List<dynamic> newList = [];

  for (dynamic obj in objects) {
    if (obj != object) newList.add(obj);
  }

  await _saveList(newList);

  if (newList.length != objects.length) return true;
  return false;
}