isProfane method

bool isProfane(
  1. String stringToTest
)

isProfane returns a boolean value representing if the string provided contains a profane word

Implementation

bool isProfane(String stringToTest) {
  final lowerCaseStringToTest = stringToTest.toLowerCase();
  return wordList
      .where((word) => lowerCaseStringToTest.contains(word))
      .isNotEmpty;
}