how to pass the query parameters as default values in buildForm? public function buildForm(array $form, FormStateInterface $form_state) {
    // in D7 it was : $params = drupal_get_query_parameters();

$form['search_api_fulltext'] = array(
'#type' =&gt; 'textfield',
'#title' =&gt; $this-&gt;t('Faites une recherche'),
  // in D7 it was: '#default_value' =&gt; isset($params['search_api_fulltext'])?str_replace('+', ' ',$params['search_api_fulltext']):'',
);
$form['actions']['#type'] = 'actions';
$form['actions']['submit'] = array(
'#type' =&gt; 'submit',
'#value' =&gt; $this-&gt;t('Recherche'),
'#button_type' =&gt; 'primary',
);
return $form;


}
there might be a better method as suggested in the comments.
I replaced 

    $params = drupal_get_query_parameters();


by 

    $params=\Drupal::request()-&gt;query-&gt;all();