How to change text of a widget depend on condition?

It should be pretty easy to alter the text for the Core text widget via the widget_text filter:

function conditional_text_widget_wpse_207957($text) {
  if (is_single()) {
    $text = "Whoa, d00d! I'm single";
  }
  return $text;
}
add_filter('widget_text','conditional_text_widget_wpse_207957');

You do not specify what conditions you need exactly, nor provide any detail about the changes you need.