startsWith function

bool startsWith(
  1. String? first,
  2. String? second, {
  3. bool ignoreCase = true,
})

Implementation

bool startsWith(String? first, String? second, {bool ignoreCase = true}) {
  if (second?.isNotEmpty != true) return false;
  if (ignoreCase) {
    first = first?.toLowerCase();
    second = second?.toLowerCase();
  }
  return first?.startsWith(second!) == true;
}