int countCharacterFrequency(String input, String char)

Source Link to Crossdart

int countCharacterFrequency(String input, String char) {
  var c = char.codeUnitAt(0);

  return input.codeUnits.where((u) => c == u).length;
}