removeItem method
Implementation
Future<void> removeItem(T data) async {
try {
emit(state.copy(isLoading: true));
await handler.delete(id: data.id);
final result = await handler.gets();
emit(state.copy(result: result.result, isLoading: false));
} catch (_) {
emit(state.copy(error: "Something went wrong!"));
rethrow;
}
}