Using String.contains(substring) to generate a list out of another fails when there is a space in my input.
Here is my code :
List<String> finalSuggestions = suggestions.where((i) => i.contains(new RegExp(pattern,caseSensitive:false, unicode: true))).toList();
As suggestions is a list of strings, and pattern is the user input. everything works fine unless the users adds a space in the string he is typing . finalSuggesions becomes null. else .. as long as the pattern is only a single word it is all fine.