delete method

Future<bool> delete()

Deletes _data from the repository. If the suppression is sucessful, returns true. Otherwise, false.

Implementation

Future<bool> delete() async {
  if (_data is! T || _data.invalid) {
    return false;
  }

  await _service.delete(_data as T);
  notifyListeners();

  return true;
}