flush_widget_cache is deprecated. Which method should i use instead?

The real question is why do you want to cache anything at all. If the widget is a common “recent posts” then all the practical object caching you are doing is mostly a duplication of the caching done in `WP_query’ when you query for the posts. Or in other words, the simplest solution is to remove the caching related code.

Update

As @jami0821 pointed out in the comments, the latest version of the theme check tool removes that specific check, so you might ask the reviewer to make sure he uses the latest version. That said, there is still no reason to keep that code around.