Name.titleCased constructor Null safety

Name.titleCased(
  1. {required String input}
)

Name.titleCased is used when the name to returned has to be titleCased

Implementation

factory Name.titleCased({required String input}) {
  final String titleCased = input
      .toLowerCase()
      .split(' ')
      .map((String e) => e.trim())
      .map((String word) => toBeginningOfSentenceCase(word))
      .join(' ');
  return Name._(right(titleCased));
}